:root {
  color-scheme: light;
  --color-page: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8f9fb;
  --color-border: #dfe3e8;
  --color-border-strong: #c9d0d8;
  --color-text: #17202a;
  --color-text-secondary: #596573;
  --color-text-muted: #7a8591;
  --color-primary: #1769e0;
  --color-primary-hover: #1159bf;
  --color-primary-soft: #edf4ff;
  --color-success: #176b45;
  --color-success-soft: #edf8f2;
  --color-warning: #8a5a08;
  --color-warning-soft: #fff7e6;
  --color-danger: #b42318;
  --color-danger-soft: #fff0ee;
  --shadow-panel: 0 1px 2px rgb(16 24 40 / 5%);
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius-sm: 4px;
  --radius-md: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
kbd,
pre,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:focus-visible {
  outline: 3px solid rgb(23 105 224 / 24%);
  outline-offset: 2px;
}

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(calc(100vh - var(--topbar-height)), auto);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.sidebar-header,
.sidebar-brand,
.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 650;
}

.sidebar-brand:hover,
.brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.brand > span:last-child,
.login-brand > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand strong,
.login-brand strong {
  line-height: 1.35;
}

.brand small,
.login-brand small {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-nav,
.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
}

.sidebar-nav a,
.nav-list a,
.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.sidebar-nav a:hover,
.nav-list a:hover,
.nav-item:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-nav a[aria-current="page"],
.sidebar-nav a.active,
.nav-list a[aria-current="page"],
.nav-list a.active,
.nav-item.active {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  font-weight: 650;
}

.sidebar-nav svg,
.nav-list svg,
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
}

.sidebar-footer form {
  margin: 0;
}

.main-area {
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  grid-column: 2;
  display: flex;
  min-width: 0;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 96%);
}

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

.topbar > div {
  min-width: 0;
}

.topbar h1,
.topbar-title h1 {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions,
.page-header > .actions,
.panel-header > .actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  max-width: 1440px;
  padding: clamp(20px, 3vw, 36px);
}

.content-narrow {
  max-width: 880px;
}

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

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.3;
}

.page-description,
.help-text,
.muted {
  color: var(--color-text-secondary);
}

.page-description {
  max-width: 760px;
  margin: 6px 0 0;
}

.section-toolbar {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-toolbar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

.section-toolbar p {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
}

.section-block {
  margin-bottom: 30px;
}

.section-block + .section-block {
  padding-top: 26px;
  border-top: 1px solid var(--color-border);
}

.panel {
  min-width: 0;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.panel-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h2,
.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.panel-body {
  padding: 20px;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.table-wrap,
.table-responsive {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: var(--color-surface);
  font-size: 14px;
}

.table th,
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: var(--color-surface-subtle);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: #fbfcfd;
}

.table .actions {
  text-align: right;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table .primary-cell {
  color: var(--color-text);
  font-weight: 600;
}

.table td > strong,
.table td > small {
  display: block;
}

.table td > small {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  content: "";
}

.status-success,
.status-ok,
.status.active,
.status.online,
.status.enabled {
  border-color: #b8dfca;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-success::before,
.status-ok::before,
.status.active::before,
.status.online::before,
.status.enabled::before {
  background: var(--color-success);
}

.status-warning,
.status-pending,
.status.pending {
  border-color: #eed49d;
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.status-warning::before,
.status-pending::before,
.status.pending::before {
  background: var(--color-warning);
}

.status-danger,
.status-error,
.status.error,
.status.offline,
.status.disabled {
  border-color: #f0bbb6;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-danger::before,
.status-error::before,
.status.error::before,
.status.offline::before,
.status.disabled::before {
  background: var(--color-danger);
}

.status-muted {
  border-color: var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
}

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

.form-grid .full,
.form-grid .field-full,
.form-grid .field-span,
.form-grid > fieldset {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field > span:first-child,
.field-label {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
}

.field > small {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.required::after,
.field label.required::after {
  margin-left: 3px;
  color: var(--color-danger);
  content: "*";
}

.field input,
.field select,
.field textarea,
.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: 0 1px 1px rgb(16 24 40 / 3%);
  outline: 0;
}

.field textarea,
.textarea {
  min-height: 112px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #929ba5;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.input:hover,
.select:hover,
.textarea:hover {
  border-color: #aeb7c2;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(23 105 224 / 13%);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
}

.help-text {
  margin: 0;
  font-size: 12px;
}

.checkbox-field,
.checkbox,
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checkbox-field input,
.checkbox input,
.check-field input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}

.check-field span {
  color: var(--color-text-secondary);
}

.stack-form {
  display: grid;
  gap: 18px;
}

.stack-form.panel {
  padding: 20px;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

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

.button-row form {
  margin: 0;
}

.button {
  display: inline-flex;
  width: auto;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.button:hover {
  border-color: #aeb7c2;
  background: var(--color-surface-subtle);
  color: var(--color-text);
  text-decoration: none;
}

.button:active {
  background: #eef0f3;
}

.button-primary,
.button.primary,
.button[type="submit"] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

.button-primary:hover,
.button.primary:hover,
.button[type="submit"]:hover {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
  color: #ffffff;
}

.button-danger,
.button.danger {
  border-color: #e4aaa4;
  background: var(--color-surface);
  color: var(--color-danger);
}

.button-danger:hover,
.button.danger:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.button-small,
.button.small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.button-quiet {
  min-height: 30px;
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--color-text-secondary);
}

.button-quiet:hover {
  border-color: var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.button-block {
  width: 100%;
}

.button-icon {
  width: 38px;
  min-width: 38px;
  padding: 8px;
}

.button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.button:disabled,
.button[aria-disabled="true"] {
  border-color: var(--color-border);
  background: #eef0f3;
  color: var(--color-text-muted);
  opacity: 0.72;
  pointer-events: none;
}

.flash {
  position: relative;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #bad0ef;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: #174f9c;
}

.flash p {
  margin: 0;
}

.flash small {
  display: block;
  margin-top: 3px;
  color: inherit;
  opacity: 0.8;
}

.flash-success,
.flash.success {
  border-color: #b8dfca;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.flash-warning,
.flash.warning {
  border-color: #eed49d;
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.flash-error,
.flash.error {
  border-color: #f0bbb6;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 36px 20px;
  color: var(--color-text-secondary);
  text-align: center;
}

.empty h2,
.empty h3,
.empty-title {
  margin: 0;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 650;
}

.empty p {
  max-width: 520px;
  margin: 0;
}

.empty-compact {
  min-height: 150px;
  padding-block: 28px;
}

.secret-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
}

.secret-box code,
.secret-value {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: #263445;
  font-size: 13px;
}

.secret-box .button {
  flex: 0 0 auto;
}

.secret-box > div:first-child {
  min-width: 0;
  flex: 1 1 42%;
}

.secret-box h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.secret-box p {
  margin: 3px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.secret-box .secret-value {
  display: flex;
  min-width: 0;
  flex: 1 1 58%;
  align-items: center;
  gap: 8px;
}

.secret-box .secret-value code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.panel-subtle {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.detail-grid > div {
  min-width: 0;
  padding: 14px 16px 14px 0;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
}

.detail-grid dt {
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.detail-grid dd {
  overflow-wrap: anywhere;
  font-weight: 550;
}

.inline-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--color-danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-danger-soft);
  color: var(--color-danger);
  overflow-wrap: anywhere;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 4px;
  border-top: 1px solid #e8b9b4;
}

.danger-zone h2 {
  margin: 0;
  color: var(--color-danger);
  font-size: 16px;
  font-weight: 650;
}

.danger-zone p {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.login-shell {
  width: min(100%, 410px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  padding: 0 2px;
  font-size: 16px;
}

.login-panel {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.login-panel h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
}

.login-panel > p {
  margin: 5px 0 20px;
  color: var(--color-text-secondary);
}

.login-panel .flash {
  margin-bottom: 18px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  margin: 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border);
}

.detail-list dt {
  color: var(--color-text-secondary);
}

.detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
  border-bottom: 0;
}

.sidebar-toggle,
.menu-button {
  display: none;
}

.menu-button {
  min-width: 42px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .topbar,
  .content,
  .main-area {
    grid-column: auto;
  }

  .main-area {
    min-height: 0;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-header,
  .sidebar-brand,
  .brand {
    min-height: 56px;
  }

  .sidebar-nav,
  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .sidebar-nav a,
  .nav-list a,
  .nav-item {
    min-height: 38px;
    padding: 7px 10px;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    min-height: 58px;
    padding: 0 20px;
  }

  .js .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(84vw, 280px);
    min-height: 100vh;
    border-right: 1px solid var(--color-border);
    border-bottom: 0;
    box-shadow: 6px 0 20px rgb(16 24 40 / 14%);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .js .sidebar-nav,
  .js .nav-list {
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 16px 12px;
  }

  .js .sidebar-footer {
    display: flex;
  }

  .js.sidebar-open,
  .js.sidebar-open body {
    overflow: hidden;
  }

  .js.sidebar-open .sidebar,
  .js .app-shell.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .js .sidebar-toggle,
  .js .menu-button {
    display: inline-flex;
  }

  .js .sidebar-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(17 24 39 / 38%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .js.sidebar-open .sidebar-backdrop,
  .js .app-shell.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    padding: 24px 20px;
  }
}

@media (max-width: 720px) {
  .page-header,
  .panel-header,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title {
    font-size: 21px;
  }

  .page-header .actions,
  .panel-header .actions {
    justify-content: flex-start;
  }

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

  .form-grid .full,
  .form-grid .field-full,
  .form-grid .field-span,
  .form-grid > fieldset,
  .form-actions {
    grid-column: auto;
  }

  .table-wrap,
  .table-responsive {
    overflow: visible;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .table tbody {
    padding: 10px 14px;
  }

  .table tbody tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
  }

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

  .table tbody tr:hover {
    background: transparent;
  }

  .table td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 12px;
    padding: 7px 2px;
    border: 0;
    overflow-wrap: anywhere;
  }

  .table td::before {
    align-self: start;
    color: var(--color-text-muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
  }

  .table td:not([data-label]) {
    display: block;
  }

  .table td:not([data-label])::before,
  .table td[data-label=""]::before {
    display: none;
  }

  .table td[data-label=""] {
    grid-template-columns: minmax(0, 1fr);
  }

  .table .actions {
    text-align: left;
    white-space: normal;
  }

  .table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .panel-body {
    padding: 16px;
  }

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

  .inline-form .button {
    width: 100%;
  }

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

  .panel-footer,
  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .panel-footer .button,
  .form-actions .button {
    width: 100%;
  }

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

  .detail-list dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .detail-list dd {
    padding-top: 2px;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 10px;
    padding: 0 14px;
  }

  .topbar h1,
  .topbar-title h1 {
    font-size: 16px;
  }

  .content {
    padding: 18px 14px;
  }

  .panel-header,
  .panel-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .secret-box {
    align-items: stretch;
    flex-direction: column;
  }

  .secret-box .secret-value {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .secret-box .button {
    width: 100%;
  }

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

  .detail-grid > div {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .detail-grid > div:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .sidebar-backdrop,
  .button,
  .flash {
    display: none !important;
  }

  .app-shell,
  .content {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
  }
}
