:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #161a20;
  --surface-muted: #1d232b;
  --panel: var(--surface);
  --panel-soft: var(--surface-muted);
  --border: #2a313a;
  --text: #eef4f8;
  --text-muted: #a6b0bb;
  --muted: var(--text-muted);
  --primary: #3f8fe5;
  --danger: #ff6b6b;
  --success: #39d98a;
  --warning: #ffd666;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  --green: #39d98a;
  --green-bg: #123b2a;
  --red: #ff6b6b;
  --red-bg: #431e24;
  --yellow: #ffd666;
  --yellow-bg: #3b3217;
  --gray: #bac4cf;
  --gray-bg: #29313a;
  --accent: #55b7ff;
  --accent-strong: #3f8fe5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 28px;
}

.topbar-actions,
.head-actions,
.section-head,
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.topbar-actions form,
.row-actions form,
.quick-actions form,
.actions form {
  margin: 0;
}

.nav-link,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-link:hover,
.nav-button:hover,
.nav-link.is-active {
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--text);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h1,
.login-panel h1,
.empty-state h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.user-chip,
.status,
.badge {
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
}

.user-chip {
  margin: 0;
  border: 1px solid var(--border);
  color: var(--muted);
}

.cabinet-user {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  border: 1px solid rgba(57, 217, 138, 0.35);
  border-radius: 8px;
  background: var(--green-bg);
  color: var(--green);
  max-height: 120px;
  overflow: hidden;
  padding: 10px 12px;
  transition: opacity 0.55s ease, transform 0.55s ease, max-height 0.55s ease, margin 0.55s ease, padding 0.55s ease;
}

.message.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.message-error {
  border-color: rgba(255, 107, 107, 0.35);
  background: var(--red-bg);
  color: #ffd7d7;
}

.message-warning {
  border-color: rgba(255, 214, 102, 0.35);
  background: var(--yellow-bg);
  color: var(--yellow);
}

.message-info {
  border-color: rgba(85, 183, 255, 0.35);
  background: #122235;
  color: #bfe4ff;
}

.subscription-list {
  display: grid;
  gap: 16px;
}

.manual-connect-head {
  margin: 24px 0 12px;
}

.manual-connect-head h2,
.manual-connect-head p {
  margin: 0;
}

.manual-connect-head p {
  margin-top: 6px;
}

.subscription-card,
.login-panel,
.empty-state,
.panel-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.subscription-card {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.card-head p {
  margin: 0;
}

.status,
.badge {
  font-size: 14px;
  font-weight: 700;
}

.status-active,
.badge-active {
  background: var(--green-bg);
  color: var(--green);
}

.status-inactive,
.badge-expired {
  background: var(--red-bg);
  color: var(--red);
}

.badge-disabled,
.badge-muted {
  background: var(--gray-bg);
  color: var(--gray);
}

.badge-warning {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.device-badge {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.device-iphone {
  background: #16334a;
  color: #8fd0ff;
}

.device-android {
  background: #173727;
  color: #7fe3a1;
}

.device-windows {
  background: #2d2f49;
  color: #b9c0ff;
}

.device-other {
  background: var(--gray-bg);
  color: var(--gray);
}

.note-snippet {
  color: var(--muted);
  font-size: 14px;
}

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

.meta-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.meta-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.primary-button,
.success-button,
.secondary-button,
.ghost-button,
.danger-button,
.primary-link,
.secondary-link,
.ghost-link,
.danger-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-button,
.primary-link {
  background: var(--accent-strong);
  color: #fff;
}

.primary-button:hover,
.primary-link:hover {
  background: var(--primary);
}

.success-button {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(57, 217, 138, 0.35);
}

.secondary-button,
.secondary-link {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-button,
.ghost-link {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.danger-button,
.danger-link {
  background: var(--red-bg);
  color: #ffd7d7;
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.small-button,
.compact {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
}

.action-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.copy-status {
  min-width: 96px;
  color: var(--green);
  font-size: 14px;
}

.link-wrap {
  margin-bottom: 18px;
}

.link-wrap.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

textarea {
  width: 100%;
  min-height: 110px;
  overflow-x: auto;
  white-space: pre;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #071018;
  color: var(--text);
  padding: 12px;
}

.single-line-textarea {
  min-height: 48px;
  height: 48px;
  resize: none;
}

.copy-source-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.subscription-url-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 18px;
  align-items: start;
}

.happ-subscription-block .section-head {
  align-items: flex-start;
}

.happ-subscription-block .section-head p {
  margin: 6px 0 0;
}

.install-onboarding-block .section-head {
  align-items: flex-start;
}

.install-onboarding-block .section-head p {
  margin: 6px 0 0;
}

.platform-select-label {
  display: grid;
  gap: 6px;
  max-width: 260px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.platform-select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #071018;
  color: var(--text);
  padding: 9px 12px;
}

.install-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.install-step-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 16px;
}

.primary-install-card {
  border-color: rgba(85, 183, 255, 0.45);
  background: #122235;
}

.step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.install-step-card h3,
.install-step-card h4,
.install-step-card p {
  margin: 0;
}

.install-step-card h4 {
  font-size: 16px;
}

.install-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.install-actions {
  align-items: stretch;
  margin-bottom: 0;
}

.install-primary-link {
  min-height: 48px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(57, 217, 138, 0.38);
}

.fallback-note {
  font-size: 14px;
}

.usage-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.usage-list li + li {
  margin-top: 6px;
}

.subscription-device-group {
  min-width: 0;
}

.cabinet-intro {
  max-width: 680px;
  margin: 10px 0 0;
}

.device-dashboard {
  margin-top: 18px;
}

.subscription-device-head {
  margin-bottom: 14px;
}

.subscription-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.subscription-stats dt,
.device-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.subscription-stats dd,
.device-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.subscription-stats dd {
  font-size: 24px;
  font-weight: 700;
}

.devices-section-head {
  align-items: center;
  margin-bottom: 10px;
}

.devices-section-head h3,
.device-summary strong {
  margin: 0;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}

.device-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  min-width: 0;
  overflow: hidden;
}

.device-card[open] {
  border-color: rgba(85, 183, 255, 0.45);
}

.device-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 14px;
}

.device-summary::-webkit-details-marker {
  display: none;
}

.device-summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.device-card[open] .device-summary::before {
  transform: rotate(90deg);
}

.device-summary-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.device-summary-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.device-summary-meta span {
  min-width: 0;
}

.device-status {
  display: inline-flex;
  margin: 0 2px;
  padding: 4px 8px;
  white-space: normal;
}

.device-details {
  border-top: 1px solid var(--border);
  padding: 14px;
}

.device-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.device-meta div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.device-actions,
.device-pending-actions,
.device-ready-actions {
  align-items: stretch;
  margin-bottom: 0;
}

.device-actions form {
  margin: 0;
}

.device-hint,
.limit-note,
.empty-devices {
  margin: 10px 0 0;
}

.empty-devices p {
  margin: 0;
}

.empty-devices p + p {
  margin-top: 4px;
}

.add-device-footer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.add-device-button {
  min-width: 240px;
  min-height: 46px;
}

.device-modal {
  width: min(440px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.device-modal::backdrop {
  background: rgba(2, 8, 13, 0.72);
}

.device-modal-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  padding: 22px;
}

.device-modal-card h3,
.device-modal-card p {
  margin: 0;
}

.device-modal-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.device-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.device-create-form {
  align-items: center;
  margin-top: 1rem;
}

.device-create-form input {
  min-width: min(220px, 100%);
}

.compact-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 220px));
  margin-bottom: 10px;
}

.params-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.params-panel h3 {
  margin: 0 0 12px;
}

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

.params-grid div {
  min-width: 0;
}

.params-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.params-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-params {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.params-details {
  min-width: 260px;
}

.params-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.warning-note {
  margin: 14px 0 0;
  border: 1px solid rgba(255, 214, 102, 0.35);
  border-radius: 8px;
  background: rgba(255, 214, 102, 0.1);
  color: #ffd666;
  padding: 10px 12px;
}

.qr-and-help {
  display: grid;
  grid-template-columns: 188px 1fr;
  gap: 18px;
  align-items: start;
}

.qr-box {
  width: 188px;
  height: 188px;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.qr-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.happ-help {
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.happ-help h3 {
  margin: 0 0 10px;
}

.happ-help ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.happ-help li + li {
  margin-top: 6px;
}

.compact-help {
  border-left: 0;
  padding-left: 0;
}

.alert {
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 8px;
  background: var(--red-bg);
  color: #ffd7d7;
  padding: 12px;
}

.empty-state,
.login-panel {
  max-width: 520px;
  padding: 24px;
}

.empty-inline {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  padding: 18px;
}

.login-panel {
  margin: 40px auto 0;
}

.login-form,
.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.login-form label,
.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.login-form input,
.stack-form input,
.stack-form select,
.stack-form textarea,
.password-input-wrap input,
.inline-form select,
.filters-form input,
.device-modal-card input,
.device-create-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #071018;
  color: var(--text);
  padding: 10px 12px;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--panel-soft);
  color: var(--text);
}

.password-toggle-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50% / 58%;
}

.password-toggle-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"] .password-toggle-icon::before {
  position: absolute;
  top: 4px;
  left: -3px;
  width: 23px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-35deg);
}

.stack-form input[type="checkbox"] {
  width: auto;
  min-height: auto;
  justify-self: start;
}

.errorlist {
  margin: 4px 0 0;
  padding: 0;
  color: #ffd7d7;
  font-size: 14px;
  list-style: none;
}

.narrow-form {
  max-width: 360px;
}

.panel-block {
  margin-top: 16px;
  padding: 20px;
}

.form-panel {
  max-width: 760px;
}

.panel-block h2,
.section-head h2 {
  margin: 0;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.stats-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 28px;
}

.stats-grid span {
  color: var(--muted);
}

.action-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.action-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 138px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.action-card-link {
  color: inherit;
}

.action-card-link:hover,
.action-card-link:focus-visible {
  border-color: var(--accent);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.action-card span {
  font-size: 24px;
  font-weight: 700;
}

.action-card p {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td {
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

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

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.xui-attach-form {
  margin-top: 12px;
}

.xui-client-grid {
  margin-top: 0;
}

.filters-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filters-form label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 14px;
}

.filters-form input,
.filters-form select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #071018;
  color: var(--text);
  padding: 8px 10px;
}

.small-meta {
  margin-top: 4px;
  font-size: 13px;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions-stacked {
  align-items: flex-start;
  min-width: 250px;
}

.quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-actions form {
  margin: 0;
}

.actions-spaced {
  margin-top: 14px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.compact-summary {
  margin-bottom: 0;
}

.technical-panel,
.danger-zone {
  box-shadow: none;
}

.danger-zone {
  border-color: rgba(255, 107, 107, 0.28);
}

.status-edit {
  margin-top: 14px;
}

.params-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px 12px;
}

.params-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.params-details[open] summary {
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1200px);
    padding-top: 12px;
  }

  .page-head,
  .card-head,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions form,
  .nav-link,
  .nav-button {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .brand {
    width: 100%;
    text-align: center;
  }

  .topbar {
    align-items: center;
  }

  .topbar-actions {
    justify-content: center;
  }

  .meta-grid,
  .params-grid,
  .device-meta,
  .qr-and-help,
  .subscription-url-layout,
  .install-steps-grid,
  .stats-grid,
  .stats-grid-four,
  .stats-grid-five,
  .action-card-grid,
  .admin-form-grid,
  .compact-params {
    grid-template-columns: 1fr;
  }

  .filters-form {
    align-items: stretch;
  }

  .filters-form label,
  .filters-form button,
  .filters-form a {
    width: 100%;
  }

  table {
    min-width: 680px;
  }

  .happ-help {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 16px 0 0;
  }

  .platform-select-label,
  .install-actions a,
  .install-actions button,
  .device-actions a,
  .device-actions button,
  .device-actions form,
  .device-create-form input,
  .device-create-form button,
  .add-device-button {
    width: 100%;
  }

  .subscription-card,
  .panel-block {
    padding: 14px;
  }

  .device-pending-actions,
  .device-ready-actions {
    width: 100%;
  }

  .device-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .device-summary-main {
    flex: 1 1 calc(100% - 24px);
  }

  .device-summary-meta {
    justify-content: flex-start;
    flex: 1 1 100%;
    padding-left: 18px;
    text-align: left;
  }

  .add-device-footer {
    margin-top: 18px;
  }

  .device-modal {
    width: min(100% - 20px, 440px);
  }

  .device-modal-card {
    padding: 16px;
  }

  .device-modal-actions {
    flex-direction: column-reverse;
  }

  .device-modal-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message,
  .device-summary::before {
    transition: none;
  }
}
