/* TGex responsive guardrails: loaded after the legacy stylesheet so mobile rules win. */
.profile-card .profile-login { height: 30px; padding: 0 10px; border: 1px solid var(--gold); border-radius: 4px; color: var(--gold); font-size: 11px; }
@media (max-width: 760px) {
  .mobile-header .header-tools { gap: 8px; }
  .mobile-login, .mobile-register { min-width: 38px; }
  .view-top > div:first-child { width: 100%; }
  .view-top .view-back { display: inline-flex; margin-bottom: 6px; }
  .view-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .view-top > div:last-child {
    align-self: flex-start;
  }

  .view-top h1 {
    line-height: 1.18;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-head .tree-tools {
    width: 100%;
    min-width: 0;
  }

  .section-head .tree-tools select {
    width: 100px;
    min-width: 0;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 27px;
    align-items: stretch;
  }

  .quick-actions button,
  .quick-actions.primary-actions button {
    height: 112px;
    min-height: 112px;
    min-width: 0;
    padding: 8px 5px;
    display: grid;
    grid-template-rows: 22px auto 24px;
    align-content: start;
    gap: 4px;
    overflow: hidden;
    text-align: center;
  }

  .quick-actions span {
    height: 22px;
    line-height: 22px;
    font-size: 19px;
  }

  .quick-actions b {
    display: block;
    min-width: 0;
    font-size: 11px;
    line-height: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .quick-actions small {
    display: -webkit-box;
    min-width: 0;
    min-height: 24px;
    max-height: 24px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    line-height: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .header-tools {
    gap: 6px;
    min-width: 0;
    flex: none;
  }

  .header-tools > button,
  .language-picker > button {
    flex: none;
    white-space: nowrap;
  }

  .mobile-register {
    min-width: 42px;
    padding: 0 5px;
  }

  #mobileSupportButton {
    min-width: 38px;
  }

  .language-picker > button {
    min-width: 45px;
    padding: 0 3px;
  }

  #mobileThemeToggle,
  #noticeButton {
    width: 18px;
    min-width: 18px;
    text-align: center;
  }
}

@media (max-width: 370px) {
  .app-main {
    padding-left: 13px;
    padding-right: 13px;
  }

  .mobile-header {
    margin-bottom: 21px;
  }

  .mobile-header .brand {
    gap: 7px;
    font-size: 17px;
  }

  .mobile-header .brand-mark {
    width: 27px;
    height: 27px;
  }

  .header-tools {
    gap: 4px;
  }

  .mobile-register {
    min-width: 39px;
    font-size: 9px !important;
  }

  #mobileSupportButton {
    min-width: 35px;
    font-size: 9px !important;
  }

  .language-picker > button {
    min-width: 42px;
    font-size: 9px !important;
  }

  .quick-actions {
    gap: 6px;
  }

  .quick-actions button,
  .quick-actions.primary-actions button {
    height: 112px;
    min-height: 112px;
    padding-left: 3px;
    padding-right: 3px;
    grid-template-rows: 22px auto 24px;
  }

  .quick-actions b {
    font-size: 10px;
    line-height: 13px;
  }

  .quick-actions small {
    min-height: 24px;
    max-height: 24px;
    font-size: 8px;
    line-height: 11px;
  }
}
