/* Shared responsive finishing rules for the Linux control panel. */
@media (max-width: 760px) {
  .app-topbar .navbar-nav,
  .app-topbar .navbar-nav .nav-item,
  .app-topbar .navbar-nav .nav-item form,
  .app-topbar .navbar-nav .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-topbar .navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .topbar-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-content {
    padding: 18px 16px;
  }

  .area-heading h1,
  .domain-heading h1,
  .domain-group-header h1 {
    font-size: clamp(1.45rem, 5vw, 1.8rem);
    line-height: 1.18;
  }

  .content-heading h2,
  .users-list-heading h2,
  .hosting-stack .content-card h2 {
    font-size: 1.08rem;
  }

  .primary-action,
  .secondary-action,
  .danger-action,
  .btn,
  .row-action {
    min-height: 38px;
    padding: 7px 10px;
    gap: 6px;
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .action-icon {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
  }

  .area-toolbar,
  .area-heading,
  .domain-heading,
  .domain-group-header {
    gap: 12px;
  }

  .app-content input:not([type="checkbox"]):not([type="radio"]),
  .app-content select,
  .app-content textarea {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .app-content {
    padding: 14px 12px;
  }

  .primary-action,
  .secondary-action,
  .danger-action,
  .btn,
  .row-action {
    min-height: 38px;
    padding: 7px 9px;
  }

  .hosting-form .primary-action,
  .dns-create-form .primary-action,
  .users-heading .primary-action {
    min-height: 44px;
  }

  .dns-records-card {
    padding: 12px;
  }

  .linux-login-layout {
    gap: 22px;
    padding: 24px 16px;
  }

  .linux-login-presentation h1 {
    max-width: 18ch;
    margin: 10px 0 14px;
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    line-height: 1.08;
  }

  .linux-login-presentation > p {
    font-size: 0.96rem;
    line-height: 1.5;
  }

  .public-service-panel {
    margin-top: 22px;
    padding: 18px;
  }

  .modern-login-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .modern-login-card h2 {
    font-size: 1.65rem;
  }
}

@media (max-width: 991.98px) {
  .dns-records-card .resource-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .dns-records-card .resource-table {
    display: block;
    min-width: 0;
  }

  .dns-records-card .resource-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .dns-records-card .resource-table tbody {
    display: grid;
    gap: 10px;
  }

  .dns-records-card .resource-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .dns-records-card .resource-table td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    min-width: 0;
    max-width: none;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .dns-records-card .resource-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .dns-records-card .resource-table td:nth-child(3),
  .dns-records-card .resource-table td:last-child {
    grid-column: 1 / -1;
  }

  .dns-records-card .resource-table td:last-child {
    border-bottom: 0;
  }

  .dns-record-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .dns-record-actions form,
  .dns-record-actions details {
    margin: 0;
  }

  .dns-record-actions details[open] {
    flex-basis: 100%;
  }

  .dns-record-form {
    min-width: 0;
    max-width: none;
  }

  .dns-record-form button {
    min-height: 42px;
    justify-self: stretch;
  }
}

@media (max-width: 430px) {
  .mobile-icon-action {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    font-size: 0;
  }

  .mobile-icon-action .ti {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
  }

  .dns-records-card .resource-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .dns-records-card .resource-table td:nth-child(3),
  .dns-records-card .resource-table td:last-child {
    grid-column: auto;
  }
}

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