/* The frame and the Overview on narrower screens, and the focus and hover
   states shared by the forms. */

@media (max-width: 1200px) {
  .dashboard-sidebar {
    width: 218px;
    padding-inline: 15px;
  }

  .dashboard-workspace {
    margin-left: 218px;
  }

  .dashboard-main {
    padding-inline: 26px;
  }

  /* Below 1200px: the next raid beside the side cards, the raid list under both. */
  .overview-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    grid-template-areas:
      "next aside"
      "main main";
    gap: 26px 18px;
  }

  .overview-columns.has-no-next {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "aside";
  }

  .overview-columns.has-no-next .overview-aside {
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  }

  /* Level with the next raid's card, under its heading. */
  .overview-columns:not(.has-no-next) .overview-aside {
    padding-top: 37px;
  }
}

@media (max-width: 1000px) {
  .page-heading {
    align-items: flex-start;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  .stat-grid {
    gap: 12px;
  }

  .preview-banner {
    padding-inline: 26px;
  }

  .preview-banner > a {
    display: none;
  }

  .integration-card {
    grid-template-columns: 1fr;
  }

  .integration-side {
    border-top: 1px solid var(--border);
  }

  .dashboard-footer {
    margin-inline: 26px;
  }
}

/* Phones: the next raid, the raid list, then the side cards. */
@media (max-width: 600px) {
  .overview-columns {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "next"
      "main"
      "aside";
  }

  .overview-columns:not(.has-no-next) .overview-aside {
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  /* The top row matches the public header on phones: 64px, a 44px logo and
     40px controls on its centre line (site/header.css). */
  .dashboard-sidebar {
    width: 100%;
    position: static;
    padding: 0 16px;
  }

  .dashboard-sidebar > .brand {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    width: max-content;
    height: 64px;
    padding-left: 0;
  }

  .dashboard-sidebar .brand-logo {
    height: 36px;
  }

  .dashboard-sidebar .server-card .server-avatar {
    width: 40px;
    height: 40px;
  }

  .server-card {
    position: absolute;
    right: 16px;
    top: 12px;
    margin: 0;
    padding: 0;
    border: none;
  }

  .server-card > div,
  .server-card > span:last-child {
    display: none;
  }

  .footer-sign-out {
    display: inline;
    margin: 0;
    font-size: 11px;
  }

  .footer-whats-new {
    display: inline-flex;
    min-height: 24px;
  }

  .sidebar-label,
  .sidebar-footer,
  .sidebar-account-slot {
    display: none;
  }

  .workspace-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    margin: 2px -16px 0;
    padding: 0 16px 10px;
    scroll-padding-inline: 16px;
    /* A fade at the edge shows the row scrolls. */
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }

  .workspace-nav a {
    flex: none;
    min-height: 40px;
    white-space: nowrap;
    padding: 0 12px;
    font-size: 12px;
    margin: 0;
    gap: 7px;
  }

  .workspace-nav a > span:first-child {
    font-size: 15px;
    width: 15px;
  }

  .sidebar-count,
  .sidebar-new {
    display: none;
  }

  .dashboard-workspace {
    margin-left: 0;
  }

  /* The page heading names the page and the server avatar the server, so
     the breadcrumb row is left out on phones. */
  .dashboard-topbar {
    display: none;
  }

  .preview-banner {
    gap: 10px;
    padding: 8px 16px;
    align-items: center;
    font-size: 11px;
    line-height: 1.4;
  }

  .dashboard-main {
    padding: 20px 16px 40px;
  }

  .page-heading {
    flex-wrap: wrap;
    gap: 19px;
  }

  .page-heading h1 {
    font-size: 31px;
  }

  .stat-grid article {
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .stat-icon .ui-icon {
    width: 16px;
    height: 16px;
  }

  .stat-grid article > div > span {
    font-size: 11px;
  }

  .stat-grid strong {
    font-size: 22px;
  }

  .stat-grid {
    gap: 10px;
    margin-bottom: 26px;
  }

  .dashboard-footer {
    margin-inline: 16px;
  }

  .settings-card {
    padding: 24px;
  }

  .integration-card > div {
    padding: 25px;
  }
}

@media (max-width: 450px) {
  .raid-date {
    width: 42px;
  }

  .filters button {
    padding-inline: 10px;
  }

  .search-label,
  .search-label input {
    width: 100%;
  }

  .form-grid {
    gap: 10px;
  }

  dialog {
    padding: 22px;
  }

  .dialog-actions {
    gap: 9px;
  }

  .dialog-actions .button {
    font-size: 11px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  /* The notes repeat the labels; phones keep the tiles to two lines. */
  .stat-grid small {
    display: none;
  }

  .dashboard-topbar {
    font-size: 11px;
  }
}

.next-step {
  background: var(--bg-warm);
  border-color: var(--border-warm);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.settings-card input:focus,
.settings-card select:focus,
#raid-form input:focus,
#raid-form select:focus,
#raid-form textarea:focus,
.sr-team-rules-fields input:focus,
.sr-team-rules-fields select:focus,
.search-label input:focus {
  border-color: var(--accent-border);
  outline: 2px solid var(--focus-ring);
  outline-offset: -1px;
}

.section-heading > a:hover {
  color: var(--accent-hover);
}

.filters button:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.integration-steps li::marker {
  color: var(--accent);
}

@media (max-width: 760px) {
  .dashboard-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .workspace-nav a {
    min-height: 42px;
  }

  .preview-banner p {
    font-size: 11px;
  }

  .preview-banner .badge {
    font-size: 10px;
  }
}
