/* Mobile and tablet presentation. Desktop at 1280px+ stays on panel.css / register.css. */

.xp-tabbar { display: none; }

.xd-welcome > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.xa-hello-greet {
  order: -1;
  margin: 0 0 4px;
  color: #1f8a4c;
  font-size: 14px;
  font-weight: 750;
}
.xa-hello-sum {
  margin: 8px 0 0;
  color: #102117;
  font-size: 16px;
  font-weight: 700;
}
.xa-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.xa-seg a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3eee7;
  color: #102117;
  font-weight: 750;
  text-decoration: none;
}

.xd-result-count {
  margin: 0 0 8px;
  color: var(--xp-muted, #5b6b86);
  font-size: 14px;
  font-weight: 700;
}

.xd-card-status {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8eefc;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.xd-acc > summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--xp-navy, #0f1b33);
}

@media (min-width: 1024px) {
  details.xd-acc > summary { display: none; }
}

@media (max-width: 1023px) {
  .xp-app { grid-template-columns: 1fr; }
  .xp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 88vw);
    transform: translateX(-110%);
    z-index: 30;
    transition: transform 0.2s ease;
    overflow: auto;
  }
  .xp-nav-check:checked ~ .xp-sidebar { transform: none; }
  .xp-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(15, 27, 61, 0.45);
  }
  .xp-nav-check:checked + .xp-nav-overlay { display: block; }
  .xp-burger,
  .xp-top-brand { display: inline-flex; align-items: center; }
  .xp-burger {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .xp-top-brand {
    color: var(--xp-navy, #0f1b33);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
  }
  .xp-top-search,
  .xp-lang,
  .xp-user-meta { display: none; }
  .xp-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    gap: 8px;
    padding: 8px 12px;
    min-height: 56px;
  }
  .xp-icon-link,
  .xp-user summary {
    min-width: 44px;
    min-height: 44px;
  }
  .xp-nav-link {
    justify-content: flex-start;
    min-height: 44px;
    padding: 11px 12px;
    font-size: 15px;
  }
  .xp-nav-text,
  .xp-nav-count,
  .xp-brand-copy,
  .xp-help { display: block; }
  .xp-content,
  .xr-shell {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    padding-bottom: 92px;
  }
  .xp-main,
  .xa-card,
  .xa-card-dash,
  .xa-card-wide,
  .xa-detail-col,
  .xd-table-card,
  .xp-match-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .xp-stats,
  .xp-metrics,
  .xd-split,
  .xd-split-3,
  .xa-detail-grid,
  .xa-summary-grid,
  .xa-score-grid { grid-template-columns: 1fr; }
  .xd-welcome,
  .xd-pagehead { flex-direction: column; align-items: stretch; }
  .xp-content h1,
  .xd-org-title { font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
  .xa-lead { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
  .xa-muted,
  .xp-stat-hint { font-size: 13px; }
  .xp-body .xa-btn,
  .xd-btn-primary,
  .xr-body .xa-btn,
  .xr-btn {
    min-height: 48px;
    box-sizing: border-box;
  }
  .xa-input,
  .xr-body .xa-input,
  .xr-phone,
  .xp-body select.xa-input,
  .xp-body textarea.xa-input {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    font-size: 16px;
  }
  .xa-search-bar,
  .xa-card-actions,
  .xp-card-actions,
  .xd-rec-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .xa-search-input {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    height: 48px;
  }
  .xa-search-bar .xa-btn,
  .xa-card-actions .xa-btn,
  .xa-card-actions form,
  .xp-card-actions .xa-btn,
  .xp-card-actions form,
  .xd-btn-primary { width: 100%; }
  .xd-watch-icon .xa-watch-btn {
    width: 48px;
    min-height: 48px;
  }
  .xa-filter-drawer {
    margin: 8px 0 12px;
    border: 1px solid var(--xp-border, #e2e6ee);
    border-radius: 12px;
    background: #fff;
    padding: 0 12px 8px;
  }
  .xa-filter-drawer summary {
    display: flex;
    align-items: center;
    min-height: 48px;
  }
  .xa-filters-extra,
  .xa-toolbar { display: grid; gap: 8px; }
  .xa-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .xa-chip-link,
  .xp-chip,
  .xa-chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .xa-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .xa-pager a { min-width: 44px; min-height: 44px; }
  .xp-choice { min-height: 56px; }
  .xp-wizard.is-js .xp-wizard-nav {
    position: sticky;
    bottom: 76px;
    z-index: 8;
    display: flex;
    gap: 8px;
    padding: 8px 0;
    background: #fff;
  }
  .xp-wizard.is-js .xp-wizard-nav .xa-btn { flex: 1; width: auto; }
  .xa-flash { list-style: none; margin: 0 0 12px; padding: 0; }
  .xa-flash-item {
    margin: 0 0 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef4ff;
    overflow-wrap: anywhere;
  }
  .xp-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 18;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--xp-border, #e2e6ee);
    padding: 2px 4px calc(2px + env(safe-area-inset-bottom));
  }
  .xp-tabbar a {
    flex: 1;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #5b6b86;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
  }
  .xp-tabbar a.is-active { color: #1f8a4c; }
  .xa-seg {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .xa-seg a {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e3eee7;
    color: #102117;
    font-weight: 750;
    text-decoration: none;
  }
  .xd-urgent-list li,
  .xd-notes-rich li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: start;
  }
  .xd-urgent-list li strong,
  .xd-notes-rich li > span:last-child { grid-column: 2; }
  .xd-acc {
    margin-top: 10px;
    border-top: 1px solid var(--xp-border, #e2e6ee);
    padding-top: 4px;
  }
  .xd-acc > summary { min-height: 44px; display: flex; align-items: center; }
  .xa-dl div,
  .xp-dl div { overflow-wrap: anywhere; }
}

@media (max-width: 760px) {
  .xp-app:has(.xd-lot-dock) .xp-tabbar { display: none; }
  .xd-source-table { display: none; }
  .xa-sources summary { min-height: 48px; display: flex; align-items: center; font-weight: 750; }
  .xp-content:has(.xd-lot-dock) { padding-bottom: 112px; }
  .xp-match-card,
  .xa-match-card {
    width: 100%;
  }
  .xd-section-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .xd-section-head a { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (max-width: 430px) {
  .xp-content h1,
  .xd-org-title,
  .xd-lot-hero h1 { font-size: 22px; }
  .xp-content { padding-left: 12px; padding-right: 12px; }
  .xr-card,
  .xr-body .xa-card { padding: 20px 14px; }
  .xr-otp { gap: 6px; }
  .xr-otp input { min-height: 48px; font-size: 18px; padding: 0; }
}

@media (max-width: 320px) {
  .xp-content,
  .xr-shell { padding-left: 10px; padding-right: 10px; }
  .xp-tabbar a { font-size: 10px; }
  .xp-top-brand { font-size: 15px; }
}
