/* FIX-HEADER-FIT 2026-10-18: header fits any phone width; text-size is a small pill, not stray boxes */
.app-header > * { min-width: 0; }
.app-header .brand, .app-header .logo-mark, .app-header .user-menu { flex: none; }
.app-header .user-menu .email-text { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* BILL-SEARCH-HEADER 2026-10-19: Ask + bill search sit side by side, wrap on phones */
.header-search-pair {
  display: flex; flex: 1 1 auto; min-width: 0; max-width: none;
  gap: 8px; flex-wrap: wrap; align-items: center;
}
.header-ask, .header-bill-search { flex: 1 1 14rem; min-width: 0; max-width: none; margin: 0; }
.header-ask input[type="search"],
.header-bill-search input[type="search"] {
  width: 100%; min-width: 0; box-sizing: border-box;
  font-size: 0.9rem; /* keep the long bill-search placeholder readable */
}
.text-size {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  background: rgba(255,255,255,.14); border-radius: 999px; padding: 2px 4px;
}
.text-size form { display: inline-flex; margin: 0; }
.text-size button {
  min-height: 0 !important; min-width: 0 !important; width: 1.75rem; height: 1.75rem;
  padding: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: transparent !important; color: #fff !important; box-shadow: none !important;
  font-size: 1rem !important; line-height: 1 !important; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.text-size button:hover:not(:disabled) { background: rgba(255,255,255,.18) !important; }
.text-size button:disabled { opacity: .35; cursor: default; }
.text-size-mark { color: #fff; font-size: .8rem; font-weight: 700; padding: 0 2px; user-select: none; }
.user-dropdown .menu-text-size { display: none; }
@media (max-width: 899px) {
  .app-header { gap: 8px; }
  .app-header .header-spacer { display: none; }
  .app-header-main > .text-size { display: none; }          /* moves into the account menu on phones */
  .user-dropdown .menu-text-size {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px;
  }
  .menu-text-size .text-size { background: #eef1f4; }
  .menu-text-size .text-size button, .menu-text-size .text-size-mark { color: #222 !important; }
  .menu-text-size .text-size button:hover:not(:disabled) { background: #dde3e8 !important; }
  /* Second header row for the two search boxes so placeholders stay readable */
  .app-header.app-header-main {
    height: auto;
    min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    flex-wrap: wrap;
    padding-bottom: 8px;
    row-gap: 6px;
  }
  .header-search-pair {
    order: 5; flex: 1 1 100%; max-width: none; width: 100%;
  }
  .header-ask, .header-bill-search { flex: 1 1 100%; max-width: none; }
  body { padding-top: calc(var(--header-h) + 5.5rem + env(safe-area-inset-top, 0px)); }
  .sidebar { top: calc(var(--header-h) + 5.5rem + env(safe-area-inset-top, 0px)); }
}
/* Date-range filters (Calendar, Agendas) wrap on phones instead of pushing the page sideways */
@media (max-width: 899px) {
  .filters label { flex-wrap: wrap; max-width: 100%; min-width: 0; }
  .filters input[type="date"], .filters select, .filters input[type="text"], .filters input[type="search"] { min-width: 0; max-width: 100%; }
}
