:root {
  color-scheme: dark;
  --bg: #061013;
  --panel: rgba(10, 19, 22, 0.94);
  --panel-strong: rgba(13, 24, 28, 0.98);
  --text: #eaf6f4;
  --muted: #96aca6;
  --accent: #7cf2cf;
  --accent-2: #7bc7ff;
  --warn: #ffcb7a;
  --danger: #ff8b8b;
  --border: rgba(152, 188, 181, 0.16);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(124, 242, 207, 0.12), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(123, 199, 255, 0.10), transparent 24%),
    linear-gradient(155deg, #04070a 0%, #071316 42%, #050b0f 100%);
  color: var(--text);
}

body {
  padding: 10px 12px 12px;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 30;
}

.topbar__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
}

.topbar-slot {
  min-width: 0;
}

.topbar-slot--start {
  display: flex;
  justify-content: flex-start;
}

.topbar-slot--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  overflow: hidden;
  z-index: 3;
}

.brand-home-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  border-radius: 12px;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1;
}

.brand-home-button:hover,
.brand-home-button:focus-visible {
  transform: translateY(-1px);
  background: rgba(124, 242, 207, 0.08);
}

.brand-home-button:focus-visible,
.surface-button--menu:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.brand-home-arrow {
  font-size: 1.05rem;
  line-height: 1;
}

.brand-home-label {
  line-height: 1;
  white-space: nowrap;
}

body[data-topbar-view="overview"] .brand-home-button {
  display: none !important;
}

body[data-layout-edit-mode] .brand-home-button {
  display: none !important;
}

#brandTitle {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.topbar__status-strip {
  margin: 0;
}

.topbar__status-strip .status-line {
  position: relative;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: nowrap;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.topbar__status-strip .status-line[data-state="ok"] {
  color: rgba(200, 255, 240, 0.92);
}

.topbar__status-strip .status-line[data-state="warn"] {
  color: rgba(255, 224, 178, 0.92);
}

.topbar__status-strip .status-line[data-state="error"] {
  color: rgba(255, 208, 208, 0.92);
}

.topbar__status-strip .status-line + .status-line::before {
  content: "·";
  margin-right: 14px;
  color: rgba(150, 172, 166, 0.72);
}

.ghost-button,
.surface-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.ghost-button,
.surface-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.surface-button--subtle {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(234, 246, 244, 0.92);
  padding-inline: 12px;
}

.surface-button--restore {
  background: rgba(255, 203, 122, 0.08);
  border-color: rgba(255, 203, 122, 0.18);
  color: #ffe6bf;
  padding-inline: 12px;
}

.surface-button--menu {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  transition: width 160ms ease, min-width 160ms ease, padding 160ms ease, border-radius 160ms ease, background 160ms ease, color 160ms ease, transform 120ms ease;
}

.surface-button--menu::before {
  content: '⋯';
  display: block;
  line-height: 1;
}

.surface-button--menu::after {
  content: '×';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
  color: rgba(234, 246, 244, 0.84);
  background: rgba(255, 255, 255, 0.06);
}

.surface-button--menu.is-open {
  width: auto;
  min-width: 0;
  padding: 8px 34px 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.surface-button--menu.is-open::before {
  content: 'Bearbeiten';
  padding-right: 6px;
}

.surface-button--menu.is-editing::before {
  content: 'Fertig';
}

.surface-button--menu.is-open::after,
.surface-button--menu.is-editing::after {
  display: grid;
}

.surface-button--menu[hidden] {
  display: none;
}

.ghost-button:hover,
.surface-button:hover {
  transform: translateY(-1px);
}

.accent-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
  color: #06110a;
  font-weight: 700;
  background: linear-gradient(160deg, var(--accent), #4df0cc);
  box-shadow: 0 12px 32px rgba(124, 242, 207, 0.18);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.accent-button:hover,
.accent-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(124, 242, 207, 0.22);
  outline: none;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  row-gap: 4px;
  margin-bottom: 8px;
}

.status-line {
  display: inline-flex;
  align-items: baseline;
}

.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 12px 0 14px;
  padding: 20px 22px;
  border-radius: 30px;
  border: 1px solid rgba(124, 242, 207, 0.20);
  background:
    linear-gradient(135deg, rgba(12, 22, 19, 0.95), rgba(8, 16, 14, 0.92)),
    linear-gradient(120deg, rgba(124, 242, 207, 0.14), transparent 30%, rgba(123, 199, 255, 0.10));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

.welcome-banner[hidden] {
  display: none;
}

.welcome-banner__copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.welcome-banner__copy h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.welcome-banner__text {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.5;
}

.welcome-progress {
  width: min(100%, 380px);
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.welcome-progress[hidden] {
  display: none;
}

.welcome-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 320ms ease, opacity 220ms ease, background 220ms ease;
  box-shadow: 0 0 18px rgba(124, 242, 207, 0.32);
}

.welcome-progress.is-active .welcome-progress__bar {
  opacity: 1;
}

.welcome-progress.is-done .welcome-progress__bar {
  width: 100%;
}

.welcome-progress.is-error .welcome-progress__bar {
  background: linear-gradient(90deg, var(--danger), #ffb2b2);
}

.welcome-banner__status {
  margin: 0;
  color: #c8fff0;
  font-weight: 700;
}

.welcome-banner__status[hidden] {
  display: none;
}

.welcome-banner__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}

.dashboard-panel {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.panel h2,
.panel h3,
.panel h4 {
  margin: 0;
}

.panel-note,
.muted,
.log {
  color: var(--muted);
}

.preview-panel {
  padding-top: 10px;
}

.dashboard-viewport {
  display: grid;
  gap: 10px;
}

.overview-shell[hidden],
.detail-shell[hidden] {
  display: none !important;
}

.dashboard-summary {
  margin: 4px 2px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.layout-controls {
  display: none;
}

.layout-controls .surface-button {
  min-height: 42px;
}

.layout-controls__finish {
  background: rgba(124, 242, 207, 0.12);
  border-color: rgba(124, 242, 207, 0.24);
}

.layout-controls__restore {
  background: rgba(255, 203, 122, 0.10);
  border-color: rgba(255, 203, 122, 0.20);
  color: #ffe6bf;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.overview-shell {
  display: grid;
  gap: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.dashboard-grid.is-edit-mode {
  min-height: 120px;
}

.overview-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 22px;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-height: 156px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

body[data-layout-edit-mode="widgets"] .overview-card {
  padding-left: 54px;
}

body[data-layout-edit-mode="dashboards"] .dashboard-card {
  padding-left: 54px;
}

body[data-layout-edit-mode] .overview-card,
body[data-layout-edit-mode] .dashboard-card {
  touch-action: none;
  -webkit-user-drag: none;
}

body[data-layout-edit-mode] {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body[data-layout-edit-mode] * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body[data-layout-edit-mode] .overview-card,
body[data-layout-edit-mode] .dashboard-card {
  animation: layout-wiggle 1.6s ease-in-out infinite;
  transform-origin: center center;
}

body[data-layout-ui-dragging="true"] .overview-card,
body[data-layout-ui-dragging="true"] .dashboard-card {
  animation: none !important;
  transition: none !important;
}

body[data-layout-edit-mode] .overview-card.sortable-chosen,
body[data-layout-edit-mode] .dashboard-card.sortable-chosen,
body[data-layout-edit-mode] .overview-card.sortable-drag,
body[data-layout-edit-mode] .dashboard-card.sortable-drag {
  animation: none;
}

body[data-layout-edit-mode] .overview-card:hover,
body[data-layout-edit-mode] .dashboard-card:hover {
  transform: none;
}

@keyframes layout-wiggle {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }

  20% {
    transform: rotate(-0.6deg) translateY(-1px);
  }

  50% {
    transform: rotate(0.5deg) translateY(0);
  }

  80% {
    transform: rotate(-0.4deg) translateY(1px);
  }
}

.overview-card--preview {
  min-height: 128px;
  gap: 8px;
}

.overview-card:hover,
.overview-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 242, 207, 0.24);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  outline: none;
}

.overview-card[data-state="offline"] {
  border-color: rgba(255, 139, 139, 0.22);
}

.overview-card[data-state="warn"] {
  border-color: rgba(255, 203, 122, 0.22);
}

.overview-card[data-alert="true"] {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 203, 122, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

body[data-layout-edit-mode="widgets"] .overview-card {
  border-style: dashed;
  border-color: rgba(124, 242, 207, 0.18);
  opacity: 0.92;
}

.overview-card__inactive-action {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  display: none;
  place-items: center;
  background: rgba(255, 139, 139, 0.18);
  border: 1px solid rgba(255, 139, 139, 0.26);
  color: #ffd0d0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body[data-layout-edit-mode="widgets"] .overview-card[data-layout-section="active"] .overview-card__inactive-action {
  display: grid;
}

body[data-layout-edit-mode="widgets"] .overview-card[data-alert="true"] .overview-card__alert {
  right: 46px;
}

.overview-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  position: relative;
  padding-right: 34px;
}

.overview-card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.overview-card__eyebrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.overview-card__label {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.05;
}

.overview-card__alert {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 203, 122, 0.14);
  border: 1px solid rgba(255, 203, 122, 0.22);
  color: #ffe1b0;
  font-size: 0.85rem;
  font-weight: 800;
  pointer-events: none;
}

.overview-card__alert[hidden] {
  display: none !important;
}

.overview-card__hero {
  display: grid;
  gap: 1px;
  align-self: end;
}

.overview-card--preview .overview-card__hero {
  align-self: start;
  gap: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.overview-card__hero--custom {
  align-self: stretch;
  width: 100%;
}

.overview-card--custom-hero .overview-card__hero {
  align-self: stretch;
  width: 100%;
}

.overview-card__value {
  font-size: clamp(1.2rem, 2.6vw, 1.78rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.overview-card__meta {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.15;
}

.overview-card__support {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.28;
  min-height: 2.2em;
}

.overview-card__preview {
  --screen-preview-width: clamp(104px, 28vw, 144px);
  --screen-preview-pad: 6px;
  width: calc(var(--screen-preview-width) + (var(--screen-preview-pad) * 2));
  height: calc((var(--screen-preview-width) / 2) + (var(--screen-preview-pad) * 2));
  border-radius: 16px;
  overflow: hidden;
  background: #05090b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
  padding: var(--screen-preview-pad);
  box-sizing: border-box;
  max-width: 100%;
}

.overview-card__preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  image-rendering: pixelated;
}

#dashboardViewport[data-recovering="true"] .overview-card::after,
#dashboardViewport[data-recovering="true"] .dashboard-card::after {
  content: '';
  position: absolute;
  inset: -20% -45%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.11) 48%, transparent 66%);
  transform: translateX(-60%);
  animation: scan-sweep 1.8s linear infinite;
  pointer-events: none;
}

#dashboardViewport[data-recovering="true"] .overview-card,
#dashboardViewport[data-recovering="true"] .dashboard-card {
  border-color: rgba(124, 242, 207, 0.18);
}

#dashboardViewport[data-source="cached"] .overview-card,
#dashboardViewport[data-source="cached"] .dashboard-card {
  border-color: rgba(255, 203, 122, 0.16);
  filter: saturate(0.72);
}

.dashboard-offline-empty {
  min-height: clamp(320px, 62vh, 680px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 36px 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
}

.dashboard-offline-empty h2,
.dashboard-offline-empty p {
  margin: 0;
}

.dashboard-offline-empty h2 {
  color: var(--text);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.dashboard-offline-empty p {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-offline-empty__recovery {
  color: var(--warn) !important;
}

@media (prefers-reduced-motion: reduce) {
  #dashboardViewport[data-recovering="true"] .overview-card::after,
  #dashboardViewport[data-recovering="true"] .dashboard-card::after {
    animation: none;
  }
}

.overview-card[data-loading="true"] .overview-card__value,
.overview-card[data-loading="true"] .overview-card__meta,
.overview-card[data-loading="true"] .overview-card__support,
.dashboard-card[data-loading="true"] .dashboard-card__value,
.dashboard-card[data-loading="true"] .dashboard-card__meta {
  opacity: 0.72;
}

.overview-card__mini {
  display: grid;
  gap: 6px;
}

.overview-card.is-edit-target {
  cursor: grab;
}

.overview-card.is-edit-target:active {
  cursor: grabbing;
}

.overview-card.sortable-chosen {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.overview-card.sortable-ghost,
.dashboard-card.sortable-ghost {
  opacity: 0.35;
  border-style: dashed;
}

.overview-card.sortable-fallback,
.dashboard-card.sortable-fallback {
  opacity: 0.88 !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  cursor: grabbing;
  animation: none !important;
}

.overview-card.sortable-fallback {
  border-color: rgba(124, 242, 207, 0.32);
}

.dashboard-card.sortable-fallback {
  border-color: rgba(124, 242, 207, 0.24);
}

/* The floating clone must not intercept drop targets through its drag handle
 * or other descendants that explicitly enable pointer events. */
.overview-card.sortable-fallback,
.overview-card.sortable-fallback *,
.dashboard-card.sortable-fallback,
.dashboard-card.sortable-fallback * {
  pointer-events: none !important;
}

.overview-card.sortable-drag,
.dashboard-card.sortable-drag {
  opacity: 0.22;
}

.overview-card__drag-handle,
.dashboard-card__drag-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: none;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(233, 249, 243, 0.88);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: grab;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  pointer-events: auto;
  z-index: 2;
}

body[data-layout-edit-mode="widgets"] .overview-card__drag-handle,
body[data-layout-edit-mode="dashboards"] .dashboard-card__drag-handle {
  display: grid;
}

body[data-layout-edit-mode="widgets"] .overview-card__drag-handle {
  background: rgba(124, 242, 207, 0.12);
  border-color: rgba(124, 242, 207, 0.22);
}

body[data-layout-edit-mode="dashboards"] .dashboard-card__drag-handle {
  background: rgba(124, 242, 207, 0.10);
  border-color: rgba(124, 242, 207, 0.18);
}

.overview-card__drag-handle:active,
.dashboard-card__drag-handle:active {
  cursor: grabbing;
}

.layout-debug-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  pointer-events: none;
}

.layout-debug-overlay[hidden] {
  display: none !important;
}

.layout-debug-overlay__pointer,
.layout-debug-overlay__box {
  position: fixed;
  pointer-events: none;
  box-sizing: border-box;
}

.layout-debug-overlay__pointer {
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(124, 242, 207, 0.96);
  background: rgba(124, 242, 207, 0.18);
  box-shadow: 0 0 0 10px rgba(124, 242, 207, 0.08);
}

.layout-debug-overlay__pointer::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: rgba(124, 242, 207, 0.96);
}

.layout-debug-overlay__box {
  border-radius: 16px;
}

.layout-debug-overlay__box--ghost {
  border: 2px solid rgba(124, 242, 207, 0.92);
  background: rgba(124, 242, 207, 0.08);
  box-shadow: 0 0 0 1px rgba(124, 242, 207, 0.20), 0 16px 30px rgba(0, 0, 0, 0.28);
}

.layout-debug-overlay__box--target {
  border: 2px dashed rgba(255, 214, 102, 0.96);
  background: rgba(255, 214, 102, 0.08);
}

.layout-debug-overlay__box--source {
  border: 2px dashed rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.04);
}

.layout-debug-overlay__label {
  position: fixed;
  left: 16px;
  bottom: 16px;
  max-width: min(60vw, 360px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(233, 249, 243, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

body[data-layout-edit-mode="widgets"] .overview-shell .overview-grid--visible {
  min-height: 140px;
}

.mini-bars {
  display: grid;
  gap: 8px;
}

.mini-bar {
  display: grid;
  gap: 4px;
}

.mini-bar__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-bar__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.detail-shell {
  display: grid;
  gap: 12px;
}

.detail-body {
  display: grid;
  gap: 10px;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px;
  display: grid;
  gap: 8px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}

.dashboard-card--group {
  padding: 0;
}

.dashboard-card__group {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dashboard-card__group > summary {
  list-style: none;
}

.dashboard-card__group > summary::-webkit-details-marker {
  display: none;
}

.dashboard-card__group-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.dashboard-card__group-summary::after {
  content: '▾';
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  margin-top: 1px;
  transition: transform 160ms ease;
}

.dashboard-card__group[open] .dashboard-card__group-summary::after {
  transform: rotate(180deg);
}

.dashboard-card__group-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-card__group-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 1px;
}

.dashboard-card__group-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-card__mini {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-card__mini[data-state="offline"] {
  border-color: rgba(255, 139, 139, 0.18);
  background: rgba(255, 139, 139, 0.05);
}

.dashboard-card__mini[data-state="online"] {
  border-color: rgba(124, 242, 207, 0.14);
}

.dashboard-card__mini-label {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.1;
}

.dashboard-card__mini-value {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.05;
  word-break: break-word;
}

.dashboard-card__mini-meta {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.dashboard-card.is-edit-target {
  cursor: grab;
}

.dashboard-card.is-edit-target:active {
  cursor: grabbing;
}

.dashboard-card[data-state="offline"] {
  border-color: rgba(255, 139, 139, 0.22);
  background: rgba(255, 139, 139, 0.06);
}

.dashboard-card[data-state="online"] {
  border-color: rgba(124, 242, 207, 0.18);
}

.dashboard-card__label {
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.05;
  word-break: break-word;
}

.dashboard-card__meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

@keyframes scan-sweep {
  0% {
    transform: translateX(-60%);
  }

  100% {
    transform: translateX(60%);
  }
}

.dashboard-card--wide {
  grid-column: 1 / -1;
}

.dashboard-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dashboard-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.dashboard-card--chart {
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-card--chart .dashboard-card__meta {
  overflow-wrap: anywhere;
}

.dashboard-chart__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-block: -4px 0;
  list-style: none;
  cursor: pointer;
}

.dashboard-chart__heading::-webkit-details-marker {
  display: none;
}

.dashboard-chart__heading:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.dashboard-chart__heading .dashboard-card__label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-chart__info-icon {
  flex: 0 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
}

.dashboard-chart__help {
  padding-block: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dashboard-chart {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.dashboard-chart__axis {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  justify-items: end;
  min-height: 220px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.72rem;
  box-sizing: border-box;
  padding-bottom: calc(1.2em + 2.4em + 16px);
}

.dashboard-chart__tick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  width: 100%;
}

.dashboard-chart__tick::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: calc(100% - 10px);
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-chart__plot {
  display: grid;
  align-items: stretch;
  min-height: 220px;
}

.dashboard-chart__bars {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: stretch;
  min-height: 220px;
  padding: 4px 0 0;
  width: 100%;
  min-width: 0;
}

.dashboard-chart__bar {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) 1.2em 2.4em;
  grid-template-areas:
    "fill"
    "value"
    "label";
  gap: 8px;
  align-items: end;
  min-height: 220px;
}

.dashboard-chart__bar-track {
  grid-area: fill;
  position: relative;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px 18px 6px 6px;
}

.dashboard-chart__bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  height: var(--bar-percent, 0%);
  max-height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(124, 242, 207, 0.95), rgba(123, 199, 255, 0.86));
}

.dashboard-chart__bar-value {
  grid-area: value;
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-chart__bar-label {
  grid-area: label;
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  min-height: 2.4em;
  overflow-wrap: anywhere;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-list__item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.dashboard-empty {
  color: var(--muted);
  padding: 12px 0;
}

.screen-shell {
  display: grid;
  gap: 14px;
}

.screen-frame {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: min(22px, 4%);
  overflow: hidden;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #000;
  min-height: 0;
}

.screen-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 0 4px;
}

.screen-info {
  color: rgba(232, 247, 244, 0.82);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.screen-status {
  color: rgba(255, 135, 135, 0.95);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.screen-frame canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.screen-canvas {
  z-index: 0;
}

.screen-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  pointer-events: none;
  z-index: 3;
}

.screen-loading[hidden] {
  display: none !important;
}

.screen-loading__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(124, 242, 207, 0.95);
  animation: screen-spinner-spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(124, 242, 207, 0.16);
}

.screen-sync-meter {
  position: relative;
  flex: 1 1 180px;
  min-width: 140px;
  height: 18px;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(8, 18, 17, 0.28);
  border: 1px solid rgba(124, 242, 207, 0.26);
  box-shadow: 0 0 10px rgba(124, 242, 207, 0.08);
  overflow: hidden;
}

.screen-sync-meter[hidden] {
  display: none !important;
}

.screen-sync-meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(124, 242, 207, 0.18), rgba(124, 242, 207, 0.82));
  box-shadow: 0 0 10px rgba(124, 242, 207, 0.14);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.screen-sync-meter__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(236, 249, 246, 0.90);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.50);
  animation: screen-sync-blink 1s steps(1, end) infinite;
}

@keyframes screen-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes screen-sync-blink {
  50% {
    opacity: 0.22;
  }
}

.screen-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.screen-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.65);
  opacity: 0;
  transition: opacity 150ms ease;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

.screen-arrow.left {
  left: 12px;
}

.screen-arrow.right {
  right: 12px;
}

.screen-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.screen-controls .surface-button {
  min-height: 44px;
  flex: 0 0 auto;
}

.provision-card,
.info-card {
  display: grid;
  gap: 12px;
}

.key-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.key-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.key-list span {
  color: var(--muted);
}

.log {
  min-height: 170px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: pre-wrap;
}

.claim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 8, 0.86);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.claim-overlay[hidden] {
  display: none;
}

.claim-modal {
  width: min(780px, 100%);
  background: rgba(9, 18, 20, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.claim-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.claim-flow {
  display: grid;
  gap: 10px;
}

.claim-step {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(124, 242, 207, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.claim-step.is-active {
  border-color: rgba(124, 242, 207, 0.28);
  box-shadow: inset 0 0 0 1px rgba(124, 242, 207, 0.04);
}

.claim-step__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.claim-step__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.claim-step__button--action {
  width: 100%;
  min-height: 84px;
  justify-content: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.claim-step.is-active .claim-step__button--action {
  background: linear-gradient(160deg, #7cf2cf, #68d5ff);
  color: #05120e;
}

.claim-step__check {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 242, 207, 0.24);
  color: rgba(124, 242, 207, 0.95);
}

.claim-step__check.is-hidden {
  opacity: 0;
}

.claim-log {
  margin-top: 14px;
  min-height: 96px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  white-space: pre-wrap;
}

.hidden-inputs {
  display: none;
}

@media (max-width: 940px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}


@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .panel-header,
  .claim-modal__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    gap: 6px;
    padding: 0 0 6px;
  }

  .topbar__row {
    gap: 6px;
  }

  .topbar-actions {
    justify-self: end;
  }

  .surface-button--subtle {
    padding-inline: 10px;
  }

  #brandTitle {
    font-size: 1.1rem;
  }

  .panel {
    padding: 14px;
    border-radius: 22px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-chart__axis {
    display: none;
  }

  .dashboard-chart__plot {
    min-height: 0;
  }

  .dashboard-chart__bars {
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 0;
  }

  .dashboard-chart__bar {
    flex: 0 0 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-rows: auto 6px;
    grid-template-areas:
      "label value"
      "fill fill";
    gap: 3px 12px;
    align-items: center;
  }

  .dashboard-chart__bar-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
  }

  .dashboard-chart__bar-fill {
    width: var(--bar-percent, 0%);
    height: 100%;
    background: linear-gradient(90deg, rgba(124, 242, 207, 0.95), rgba(123, 199, 255, 0.86));
  }

  .dashboard-chart__bar-value {
    font-size: 1.1rem;
    white-space: nowrap;
    text-align: right;
  }

  .dashboard-chart__bar-label {
    font-size: 1rem;
    min-height: 0;
    overflow-wrap: normal;
  }
}

@media (max-width: 520px) {
  .brand-home-label {
    display: none;
  }

  .brand-home-button {
    padding-inline: 8px;
    min-width: 48px;
  }
}

/* Keep two compact dashboard columns on current high-DPR phones (about
 * 360 CSS px wide). Only exceptionally narrow viewports need one column. */
@media (max-width: 359px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
