:root {
  color: #f5f5f5;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #050505;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #050505;
}

a {
  color: #f5f5f5;
  text-underline-offset: 3px;
}

.shell {
  position: relative;
  display: flex;
  width: min(100% - 32px, 520px);
  min-height: 100vh;
  margin: auto;
  padding: 64px 0 28px;
  flex-direction: column;
  align-items: center;
}

.card {
  width: 100%;
  padding: 38px;
  border: 1px solid #252525;
  border-radius: 22px;
  background: #0d0d0d;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px rgba(255, 255, 255, 0.035);
}

.login-logo {
  display: block;
  width: min(100%, 290px);
  height: auto;
  margin: 0 auto 24px;
}

h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.85rem, 7vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.intro {
  margin: 13px 0 29px;
  color: #a3a3a3;
  font-size: 1rem;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 14px;
}

label,
legend {
  color: #e5e5e5;
  font-size: 0.84rem;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #333333;
  border-radius: 11px;
  outline: none;
  color: #ffffff;
  background: #080808;
  font: inherit;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

select {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #333333;
  border-radius: 11px;
  color: #ffffff;
  background: #080808;
  font: inherit;
}

input::placeholder {
  color: #666666;
}

input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

button {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  color: #050505;
  background: #ffffff;
  box-shadow: none;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.cf-turnstile {
  width: 100%;
  min-width: 300px;
  min-height: 65px;
  margin-top: 2px;
  justify-self: center;
}

.legal-note {
  color: #777777;
  font-size: 0.77rem;
  line-height: 1.55;
  text-align: center;
}

.legal-note {
  margin: 20px 5px 0;
}

.form-error {
  margin: 0;
  padding: 11px 13px;
  max-height: 60px;
  overflow: hidden;
  border: 1px solid #7f1d1d;
  border-radius: 10px;
  color: #fecaca;
  background: #2a0d0d;
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: center;
  animation:
    error-shake 480ms ease-in-out,
    error-dismiss 500ms ease 2.5s forwards;
}

@keyframes error-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes error-dismiss {
  from {
    max-height: 60px;
    margin-bottom: 0;
    padding-block: 11px;
    border-width: 1px;
    opacity: 1;
  }
  to {
    max-height: 0;
    margin-bottom: -14px;
    padding-block: 0;
    border-width: 0;
    opacity: 0;
  }
}

.back-link {
  display: inline-block;
  margin-bottom: 26px;
  color: #8f8f8f;
  font-size: 0.82rem;
  text-decoration: none;
}

.back-link:hover {
  color: #ffffff;
}

.code-fieldset {
  min-width: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}

.code-fieldset legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}

.code-digit {
  min-width: 0;
  height: 58px;
  padding: 0;
  font-size: 1.45rem;
  font-weight: 720;
  text-align: center;
}

.account-card dl {
  display: grid;
  margin: 0 0 30px;
  gap: 12px;
}

.account-summary,
.gateway-claim-card,
.gateway-section {
  width: 100%;
  margin-bottom: 22px;
}

.account-summary h1 {
  margin-bottom: 24px;
}

.gateway-claim-card h2,
.gateway-heading h2,
.gateway-card h3 {
  margin: 0;
  color: #f5f5f5;
}

.gateway-claim-card h2,
.gateway-heading h2 {
  font-size: 1.15rem;
}

.gateway-heading,
.gateway-card-header,
.gateway-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gateway-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.gateway-title-group h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.gateway-rename {
  width: auto;
  min-height: 0;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.7rem;
}

.gateway-heading {
  margin: 8px 4px 14px;
}

#gateway-count,
.gateway-metadata,
.gateway-empty,
.gateway-message,
.scan-summary {
  color: #858585;
  font-size: 0.82rem;
}

.gateway-list {
  display: grid;
  width: 100%;
  gap: 14px;
}

.gateway-card {
  padding: 24px;
}

.gateway-card h3 {
  font-size: 1rem;
}

.gateway-status {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.gateway-status.online {
  color: #bbf7d0;
  background: #12351f;
}

.gateway-status.offline {
  color: #d4d4d4;
  background: #272727;
}

.gateway-metadata {
  margin: 12px 0 18px;
  line-height: 1.55;
}

.gateway-actions button {
  flex: 1;
}

.gateway-message {
  min-height: 18px;
  margin: 12px 0 0;
  text-transform: capitalize;
}

.scan-results {
  margin-top: 14px;
}

.scan-summary {
  margin: 0 0 8px;
}

.arp-devices {
  display: grid;
  max-height: 300px;
  overflow: auto;
  border: 1px solid #242424;
  border-radius: 10px;
}

.arp-devices div {
  display: flex;
  flex-wrap: wrap;
  padding: 9px 11px;
  justify-content: space-between;
  gap: 12px;
}

.arp-devices div + div {
  border-top: 1px solid #242424;
}

.arp-devices code {
  color: #a3a3a3;
}

.miner-ip {
  min-height: 0;
  padding: 0;
  border-radius: 3px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  text-align: left;
}

.miner-ip:disabled {
  cursor: default;
  opacity: 1;
}

.miner-ip:not(:disabled) {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.miner-hashrate {
  margin-left: auto;
  color: #ffffff;
  white-space: nowrap;
}

.miner-type {
  color: #8f8f8f;
  white-space: nowrap;
}

.miner-name {
  width: 100%;
  color: #fff;
}

.miner-display {
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 12px;
  color: #b7b7b7;
}

.miner-fan {
  white-space: nowrap;
}

.miner-pool {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.miner-management {
  display: grid;
  margin: 18px 0;
  gap: 7px;
}

.miner-name-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.miner-delete {
  width: 100%;
  margin-top: 16px;
}

.miner-presence {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
}

.miner-device-status {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.miner-device-status.online {
  color: #bbf7d0;
  background: #12351f;
}

.miner-device-status.offline {
  color: #fecaca;
  background: #451a1a;
}

.miner-last-seen {
  color: #777;
}

.admin-profiles {
  width: min(100%, 860px);
}

.shell:has(.admin-profiles) {
  width: min(100% - 32px, 860px);
}

.profile-card {
  padding: 24px;
}

.profile-card h2 {
  margin: 0;
  font-size: 1rem;
}

.profile-editor {
  width: 100%;
  min-height: 460px;
  margin-bottom: 14px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #333;
  border-radius: 11px;
  color: #e5e5e5;
  background: #080808;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.miner-dialog {
  width: min(92vw, 620px);
  max-height: 88vh;
  padding: 0;
  overflow: auto;
  border: 1px solid #333333;
  border-radius: 18px;
  color: #f5f5f5;
  background: #0d0d0d;
}

.miner-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.miner-dialog-card {
  position: relative;
  padding: 28px;
}

.miner-dialog-card h2 {
  max-width: calc(100% - 50px);
  margin: 0;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.35rem;
}

.miner-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
  gap: 12px;
}

.miner-live-metrics {
  display: grid;
  margin: 22px 0 20px;
  padding: 0 0 22px;
  border-bottom: 1px solid #2b2b2b;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.miner-live-metrics div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.miner-live-metrics span {
  color: #858585;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.miner-live-metrics strong {
  overflow: hidden;
  color: #fff;
  font-size: 1.15rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-feedback {
  width: min(calc(100% - 32px), 430px);
  padding: 0;
  border: 1px solid #333;
  border-radius: 18px;
  opacity: 1;
  color: #f5f5f5;
  background: #111;
  transition: opacity 250ms ease, transform 250ms ease;
}

.operation-feedback::backdrop {
  background: rgba(0, 0, 0, 0.72);
  transition: opacity 250ms ease;
}

.operation-feedback.is-closing {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.operation-feedback.is-closing::backdrop {
  opacity: 0;
}

.operation-feedback-card {
  padding: 32px;
  text-align: center;
}

.operation-feedback-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border: 4px solid #555;
  border-top-color: #fff;
  border-radius: 50%;
  animation: operation-spin 800ms linear infinite;
}

.operation-feedback.success .operation-feedback-icon,
.operation-feedback.error .operation-feedback-icon {
  display: grid;
  border: 0;
  animation: none;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.operation-feedback.success .operation-feedback-icon {
  color: #bbf7d0;
  background: #12351f;
}

.operation-feedback.success .operation-feedback-icon::before {
  content: "✓";
}

.operation-feedback.error .operation-feedback-icon {
  color: #fecaca;
  background: #491919;
}

.operation-feedback.error .operation-feedback-icon::before {
  content: "!";
}

.operation-feedback h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.operation-feedback p {
  margin: 0;
  color: #aaa;
  line-height: 1.55;
}

.operation-feedback button {
  width: 100%;
  margin-top: 24px;
}

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

.miner-field {
  display: grid;
  gap: 7px;
}

button.danger {
  color: #fecaca;
  background: #7f1d1d;
}

@media (max-width: 540px) {
  .miner-fields {
    grid-template-columns: 1fr;
  }

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

.account-card dl div {
  display: flex;
  padding: 15px 16px;
  border: 1px solid #242424;
  border-radius: 11px;
  background: #090909;
  justify-content: space-between;
  gap: 20px;
}

dt {
  color: #858585;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.role {
  color: #ffffff;
  text-transform: capitalize;
}

button.secondary {
  color: #f0f0f0;
  background: #242424;
  box-shadow: none;
}

.legal-card {
  color: #aaaaaa;
  line-height: 1.7;
}

.legal-card h1 {
  margin-bottom: 24px;
}

.legal-card h2 {
  margin: 28px 0 6px;
  color: #eeeeee;
  font-size: 1rem;
}

.legal-card p {
  margin: 0 0 12px;
}

.eyebrow {
  color: #777777;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 22px, 520px);
    padding-top: 28px;
  }

  .card {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .code-inputs {
    gap: 6px;
  }

  .code-digit {
    height: 52px;
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .form-error {
    animation: error-dismiss 1ms linear 3s forwards;
  }
}

/* Vision account dashboard */
.shell:has(.vision-dashboard) {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
  align-items: stretch;
}

.vision-dashboard {
  display: grid;
  width: 100%;
  height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 0, rgba(255, 255, 255, 0.04), transparent 28rem),
    #050505;
}

.dashboard-sidebar {
  z-index: 20;
  display: flex;
  min-height: 0;
  padding: 27px 18px 20px;
  border-right: 1px solid #242424;
  flex-direction: column;
  background: #0a0a0a;
}

.dashboard-logo {
  display: block;
  width: 180px;
  margin: 0 auto;
  padding: 11px 10px 25px;
}

.dashboard-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.beta-banner {
  margin: 0 5px 18px;
  padding: 12px 13px;
  border: 1px solid #333;
  border-radius: 10px;
  color: #aaa;
  background: #151515;
  font-size: 0.76rem;
  line-height: 1.45;
}

.beta-banner strong {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.beta-banner span {
  margin-right: 0.25em;
}

.beta-banner a {
  color: #fff;
  font-weight: 750;
}

.dashboard-nav {
  min-height: 0;
  overflow-y: auto;
}

.nav-item,
.gateway-nav-item,
.nav-logout {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #b9b9b9;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-item:hover,
.gateway-nav-item:hover,
.nav-item.active,
.gateway-nav-item.active {
  color: #fff;
  background: #1c1c1c;
}

.nav-item.active,
.gateway-nav-item.active {
  box-shadow: inset 3px 0 #ffffff;
}

.nav-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #dedede;
  background: #292929;
  font-size: 0.7rem;
  text-align: center;
}

.nav-separator {
  height: 1px;
  margin: 15px 10px 17px;
  background: #242424;
}

.nav-section-heading {
  display: flex;
  padding: 0 11px 8px;
  align-items: center;
  justify-content: space-between;
  color: #777;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.nav-section-heading a {
  color: #ffffff;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.gateway-nav-list {
  display: grid;
  gap: 3px;
}

.gateway-nav-item > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gateway-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #555;
}

.gateway-dot.online {
  background: #42c975;
  box-shadow: 0 0 9px rgba(66, 201, 117, 0.35);
}

.nav-loading {
  display: block;
  padding: 10px 13px;
  color: #666;
  font-size: 0.78rem;
}

.dashboard-nav-bottom {
  display: grid;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #242424;
  gap: 3px;
}

.dashboard-nav-bottom form {
  display: block;
}

.nav-logout {
  min-height: 46px;
  color: #f0a3a3;
  text-align: left;
}

.nav-logout:hover {
  background: #2a1212;
}

.dashboard-workspace {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.editable-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.editable-title-row h1 {
  margin: 0;
}

.rename-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #353535;
  border-radius: 9px;
  color: #bbb;
  background: #151515;
  font-size: 0.78rem;
  white-space: nowrap;
}

.rename-hint-dismiss {
  width: auto;
  min-height: 0;
  padding: 7px 11px;
  border: 1px solid #444;
  color: #fff;
  background: #242424;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .editable-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .rename-hint {
    white-space: normal;
  }
}

.dashboard-panel {
  width: 100%;
  max-width: 1500px;
  min-height: 100%;
  margin: 0 auto;
  padding: 54px clamp(26px, 4vw, 68px) 70px;
}

.panel-heading {
  display: flex;
  margin-bottom: 28px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading .eyebrow {
  margin: 0 0 7px;
  color: #ffffff;
}

.panel-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.panel-summary,
.table-state {
  color: #888;
  font-size: 0.88rem;
}

.table-state {
  padding: 44px 30px;
  border: 1px dashed #2e2e2e;
  border-radius: 15px;
  background: rgba(13, 13, 13, 0.75);
  text-align: center;
}

.miner-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #292929;
  border-radius: 16px;
  background: rgba(13, 13, 13, 0.93);
}

.miner-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.miner-table th,
.miner-table td {
  height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid #242424;
  text-align: left;
  white-space: nowrap;
}

.miner-table th {
  height: 48px;
  color: #777;
  background: #111;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: normal;
}

.miner-table tbody tr:last-child td {
  border-bottom: 0;
}

.miner-table tbody tr.miner-row-online td {
  background: rgba(35, 134, 75, 0.13);
}

.miner-table tbody tr.miner-row-offline td {
  background: rgba(156, 52, 52, 0.13);
}

.miner-table tbody tr.miner-row-online:hover td {
  background: rgba(35, 134, 75, 0.2);
}

.miner-table tbody tr.miner-row-offline:hover td {
  background: rgba(156, 52, 52, 0.2);
}

.miner-select-column {
  width: 48px;
  min-width: 48px;
  text-align: center !important;
}

.miner-select-column input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #fff;
}

.bulk-toolbar {
  display: flex;
  min-height: 54px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #292929;
  border-radius: 12px;
  align-items: center;
  gap: 12px;
  background: #101010;
}

.bulk-toolbar[hidden] {
  display: none;
}

.bulk-selection-count {
  color: #ddd;
  font-weight: 700;
}

.bulk-restart,
.bulk-pool {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
}

.bulk-pool-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #333;
  border-radius: 18px;
  color: #fff;
  background: #0d0d0d;
}

.bulk-pool-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.bulk-pool-card {
  display: grid;
  gap: 10px;
  padding: 28px;
}

.bulk-pool-card h2,
.bulk-pool-card p {
  margin: 0 0 8px;
}

.bulk-pool-card input {
  width: 100%;
}

.optional-label {
  color: #888;
  font-weight: 500;
}

.bulk-pool-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 620px) {
  .bulk-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-pool-actions { grid-template-columns: 1fr; }
}

.bulk-status {
  color: #999;
  font-size: 0.86rem;
}

.miner-table-name {
  color: #ffffff;
  font-weight: 750;
  white-space: nowrap;
}

.miner-row-clickable {
  cursor: pointer;
}

.miner-row-clickable:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -3px;
}

.panel-card {
  padding: 28px;
  border: 1px solid #292929;
  border-radius: 16px;
  background: #0d0d0d;
}

.compact-panel-card {
  max-width: 610px;
}

.firmware-flasher-card {
  margin-top: 24px;
}

.firmware-flasher-card h2,
.firmware-admin-config h2 {
  margin-bottom: 10px;
}

.firmware-steps {
  margin: 18px 0 22px;
  padding-left: 1.4rem;
  color: #b3b3b3;
  line-height: 1.55;
}

.firmware-steps li + li {
  margin-top: 8px;
}

.firmware-steps strong {
  color: #f5f5f5;
}

.firmware-meta {
  margin: 14px 0;
  color: #999;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.firmware-actions {
  display: flex;
  gap: 10px;
}

.firmware-actions button {
  flex: 1;
}

.firmware-progress-wrap {
  margin-top: 20px;
}

.firmware-progress-heading {
  display: flex;
  margin-bottom: 8px;
  color: #b3b3b3;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}

.firmware-progress-heading strong {
  color: #fff;
}

.firmware-progress-wrap progress {
  width: 100%;
  height: 14px;
  display: block;
  accent-color: #fff;
}

.firmware-status {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: #aaa;
  line-height: 1.5;
}

.firmware-status[data-state="success"] {
  color: #bbf7d0;
}

.firmware-status[data-state="error"] {
  color: #fecaca;
}

.firmware-admin-config {
  margin-top: 22px;
}

.firmware-admin-config #firmware-admin-save {
  width: auto;
  min-height: 42px;
  padding: 9px 15px;
}

.firmware-public-toggle {
  display: flex;
  margin: 24px 0 12px;
  align-items: center;
  gap: 10px;
}

.firmware-public-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.gateway-detail-heading {
  margin-bottom: 0;
  align-items: center;
}

.gateway-detail-heading .gateway-metadata {
  margin: 7px 0 0;
  color: #888;
  font-size: 0.86rem;
}

.gateway-header-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.gateway-header-actions button {
  width: auto;
  min-height: 40px;
  padding: 9px 16px;
  flex: none;
  border-radius: 9px;
  font-size: 0.86rem;
}

.gateway-header-actions .danger {
  min-width: 88px;
}

.gateway-header-message {
  min-height: 20px;
  margin: 4px 0 20px;
  color: #888;
  font-size: 0.84rem;
}

.gateway-name-edit {
  min-height: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
}

.gateway-name-edit:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.gateway-title-input {
  min-height: 0;
  padding: 4px 8px;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.inline-rename {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.gateway-miner-section {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 16px;
}

.miner-aggregates {
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.miner-aggregates[hidden] {
  display: none;
}

.miner-aggregates > div {
  display: grid;
  gap: 7px;
  padding: 17px 18px;
  border: 1px solid #292929;
  border-radius: 13px;
  background: #0d0d0d;
}

.miner-aggregates span {
  color: #858585;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.miner-aggregates strong {
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .miner-aggregates {
    grid-template-columns: 1fr;
  }
}

#gateway-detail,
.gateway-miner-section > div,
.gateway-miner-section .miner-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.settings-card {
  max-width: 680px;
}

.miner-panel-heading {
  margin-bottom: 22px;
}

.miner-controls-card {
  width: 100%;
  max-width: 980px;
}

.miner-controls-card .miner-management {
  max-width: 720px;
}

.miner-show-all {
  width: 100%;
  margin: 0 0 18px;
}

.admin-ui-config {
  max-width: 960px;
  margin-bottom: 38px;
}

.admin-stats {
  display: grid;
  max-width: 320px;
  margin-bottom: 24px;
}

.admin-stat-card {
  display: grid;
  gap: 6px;
}

.admin-stat-card span,
.admin-stat-card small {
  color: #929292;
}

.admin-stat-card strong {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
}

.admin-ui-config h2,
.admin-ui-config h3,
.admin-profile-heading {
  margin-top: 0;
}

.admin-ui-config h3 {
  margin: 22px 0 10px;
  font-size: 0.92rem;
}

.admin-option-grid {
  display: grid;
  max-width: 720px;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-check-option {
  display: flex;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #2b2b2b;
  border-radius: 9px;
  align-items: center;
  gap: 9px;
  background: #090909;
  justify-content: space-between;
}

.admin-option-choice {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 9px;
  text-transform: capitalize;
}

.admin-option-key {
  width: 180px;
  flex: 0 0 180px;
  color: #999;
}

.admin-option-choice input.admin-label-input {
  width: min(260px, 100%);
  min-height: 34px;
  padding: 6px 9px;
  text-transform: none;
}

.admin-option-choice input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.admin-order-controls {
  display: flex;
  gap: 5px;
}

button.admin-order-button {
  width: 32px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #333;
  border-radius: 7px;
  color: #ddd;
  background: #202020;
  font-size: 0.85rem;
}

#dashboard-ui-save {
  margin-top: 24px;
}

.admin-profile-heading {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.settings-card dl {
  display: grid;
  margin: 0;
  gap: 12px;
}

.settings-card dl div {
  display: flex;
  padding: 17px;
  border: 1px solid #242424;
  border-radius: 11px;
  justify-content: space-between;
  gap: 18px;
}

.mobile-dashboard-header,
.sidebar-toggle,
.sidebar-backdrop {
  display: none;
}

#panel-profiles .gateway-list {
  max-width: 960px;
}

@media (max-width: 980px) {
  .vision-dashboard {
    display: block;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 300px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar-open .dashboard-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.72);
    transition: opacity 180ms ease;
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-toggle {
    position: fixed;
    z-index: 10;
    top: 15px;
    left: 16px;
    display: block;
    width: 44px;
    min-height: 44px;
    padding: 0;
    color: #fff;
    background: #1d1d1d;
    font-size: 1.1rem;
  }

  .mobile-dashboard-header {
    display: flex;
    height: 74px;
    padding: 0 20px 0 74px;
    border-bottom: 1px solid #242424;
    align-items: center;
    font-weight: 750;
  }

  .mobile-dashboard-logo {
    display: block;
    width: 112px;
    line-height: 0;
  }

  .mobile-dashboard-logo img {
    display: block;
    width: 100%;
    height: auto;
  }

  .dashboard-workspace {
    height: 100vh;
  }

  .dashboard-panel {
    min-height: calc(100% - 74px);
    padding-top: 32px;
  }
}

@media (max-width: 680px) {
  .dashboard-panel {
    padding: 28px 15px 45px;
  }

  .panel-heading {
    margin-bottom: 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .panel-heading h1 {
    font-size: 2rem;
  }

  .panel-card {
    padding: 20px;
  }

  .gateway-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gateway-header-actions {
    width: 100%;
    flex-direction: row;
  }

  .gateway-header-actions button {
    flex: 1;
  }

  .firmware-actions {
    flex-direction: column;
  }

  .inline-rename,
  .miner-name-actions {
    grid-template-columns: 1fr;
  }
}
