dialog {
  padding: 0;
  border: 1px solid #30394b;
  border-radius: 20px;
  background: #0e131c;
  color: var(--text);
  box-shadow: var(--shadow);
  width: min(430px, calc(100% - 32px));
}
dialog::backdrop { background: #02040acb; backdrop-filter: blur(5px); }
.dialog-card { padding: 22px; }
.dialog-card label { display: grid; gap: 7px; color: #bdc4d3; margin: 14px 0; }
.dialog-close { border: 0; background: transparent; color: #aeb7c7; font-size: 24px; cursor: pointer; }
.sidebar-foot div { display: flex; gap: 8px; }
.menu-close,
.menu-backdrop { display: none; }
.source-error {
  color: #ff8fa0;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

@media (max-width: 760px) {
  body.menu-open { overflow: hidden; }
  .login-shell {
    min-height: 100dvh;
    place-items: start center;
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  }
  .login-card { margin-top: 14px; border-radius: 22px; }
  .login-logo { width: 70px; height: 70px; margin-bottom: 16px; }
  .login-card h1 { font-size: 28px; }
  .login-card .muted { margin-bottom: 20px; }

  .sidebar {
    left: -100vw;
    width: min(86vw, 340px);
    max-width: 340px;
    padding-top: max(24px, env(safe-area-inset-top));
  }
  .sidebar.open { left: 0; width: min(86vw, 340px); }
  .brand { padding-right: 0; }
  .brand > div { min-width: 0; }
  .menu-close {
    display: grid;
    place-items: center;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid #293143;
    border-radius: 12px;
    background: #121722;
    color: #fff;
    font-size: 26px;
  }
  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    border: 0;
    background: #02040ab8;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .menu-backdrop.open { opacity: 1; pointer-events: auto; }

  .content { padding-bottom: max(30px, env(safe-area-inset-bottom)); }
  .panel { padding: 16px; border-radius: 16px; }
  .panel-head { align-items: flex-start; }
  .panel-head > div { min-width: 0; }
  .panel-head .btn { flex: 0 0 auto; }
  .toast {
    left: 12px;
    right: 12px;
    top: max(12px, env(safe-area-inset-top));
    max-height: 34dvh;
    overflow: auto;
  }

  .table-wrap { overflow: visible; }
  .data-table,
  .data-table tbody { display: block; min-width: 0; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr {
    display: block;
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid #252e3e;
    border-radius: 14px;
    background: #101620;
  }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid #202838;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: #7f899d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
  }
  .data-table td[data-label=""] { justify-content: flex-end; }
  .data-table td[data-label=""]::before { display: none; }
  .data-table .name,
  .data-table .sub { text-align: right; }
  .data-table .source-error {
    max-width: 52vw;
    white-space: normal;
  }
  .data-table .actions { justify-content: flex-end; flex-wrap: wrap; }
  .data-table .switch { flex: 0 0 auto; }
  .new-codes pre { font-size: 13px; }
}

@media (max-width: 430px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card strong { font-size: 24px; }
  .data-table td::before { flex-basis: 38%; }
}
