/* Mobil öncelikli iyileştirmeler. Master sayfaları bu dosyayı yüklemez. */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding: 10px; overflow-x: hidden; }
  .page, .page-frame { width: 100%; max-width: 100%; padding: 12px; border-radius: 14px; }

  .brand-header, .brand-header.home-brand {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 52px;
    margin-bottom: 12px;
  }
  .brand-logo { width: 52px; height: 52px; }
  .site-title { font-size: clamp(32px, 10vw, 42px); min-width: 0; }
  .home-link-top { padding: 9px 10px; min-height: 42px; }
  .header-action-links { gap: 6px; flex-wrap: nowrap; }

  .page-subtitle { min-height: 0; padding: 12px; gap: 8px; }
  .title { font-size: clamp(22px, 6.5vw, 27px); overflow-wrap: anywhere; }
  .title-icon { width: 28px; height: 28px; font-size: 25px; }

  .top-actions, .inline-actions { gap: 8px; }
  .top-link-btn, .text-link-button, button, input, select, textarea { font-size: 16px; }
  .top-link-btn, .text-link-button { min-height: 44px; }

  .card, .section-card { border-radius: 13px; }
  .card { padding: 12px; }
  .section-body, .panel-content { padding-left: 12px; padding-right: 12px; }

  .contact-link { min-height: 52px; padding: 12px; align-items: flex-start; }
  .contact-text { min-width: 0; overflow-wrap: anywhere; }

  .legal-nav { align-items: stretch; }
  .legal-nav a, .legal-footer-home { flex: 1 1 145px; justify-content: center; text-align: center; min-height: 44px; }
  .legal-section { overflow-wrap: anywhere; }
  .legal-section table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .record-action-row, .saved-item { grid-template-columns: 1fr; }
  .save-button {
    width: auto;
    min-width: 96px;
    max-width: 140px;
    min-height: 44px;
    padding: 11px 16px;
    justify-self: end;
  }
  .gallery-button { min-height: 50px; }

  .provider-change-card { padding: 16px; }
  .provider-change-effects { padding-left: 18px; }
}

@media (max-width: 520px) {
  body { padding: 7px; }
  .page, .page-frame { padding: 9px; border-width: 1px; border-radius: 12px; }
  .brand-header, .brand-header.home-brand {
    grid-template-columns: 44px minmax(0,1fr) auto;
    gap: 7px;
  }
  .brand-logo { width: 44px; height: 44px; }
  .site-title { font-size: clamp(29px, 9.5vw, 37px); }
  .home-link-top { font-size: 0; width: 44px; padding: 0; justify-content: center; }
  .header-action-links > .top-link-btn:first-child { padding-left: 9px; padding-right: 9px; }
  .header-action-links > .top-link-btn:not(.home-link-top) { min-height: 44px; font-size: 12px; gap: 4px; }
  .header-action-links > .top-link-btn:not(.home-link-top) .top-icon { font-size: 16px; }
  .home-link-top .nav-icon { width: 21px; height: 21px; }
  .page-subtitle { padding: 10px 8px; }
  .panel-title-wrap { gap: 7px; }
  .title { font-size: 22px; }
  .section-header { padding-left: 11px; padding-right: 11px; }
  .section-body, .panel-content { padding-left: 10px; padding-right: 10px; }
  .legal-footer { gap: 8px 12px; }
}

/* Kayıtlı kişiler: Kod/Sil grubu orta ve dar mobil genişliklerde
   ait olduğu kişi butonuna bitişik ve sağda kalır. */
@media (max-width: 760px) {
  .saved-item {
    gap: 0;
    justify-items: stretch;
  }

  .saved-action-tab {
    justify-self: end;
    align-self: auto;
    gap: 6px;
    margin-top: -1px;
    padding: 6px;
    background: #dff1ff;
    border: 1px solid #a9d7ff;
    border-top: 0;
    border-radius: 0 0 12px 12px;
  }

  .saved-action-tab .top-link-btn,
  .saved-action-tab .danger-button {
    min-width: 68px;
    min-height: 40px;
    height: 40px;
    padding: 8px 11px;
    border-radius: 8px;
  }

  .saved-action-tab .top-link-btn {
    border-radius: 8px;
  }

  .saved-action-tab .danger-button {
    border-radius: 8px;
  }
}
