/* Option 3: one-tap recent months, with a full custom archive on web and mobile. */
.partner-portal .partner-section-heading .partner-month-select.pm-source { display: none; }
.partner-month-select[hidden] + .partner-month-picker { display: none; }
.partner-month-picker {
  box-sizing: border-box;
  flex: 0 0 320px;
  width: 320px;
  max-width: 100%;
  min-width: 0;
  color: #1e2a6b;
}
.partner-month-picker .pm-label {
  margin: 0 0 8px;
  color: #465d78;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
}
.pm-rail {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: 5px;
  border: 1px solid #c8d8eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px #17376908;
}
.pm-recent { display: grid; grid-template-columns: repeat(var(--pm-count, 5), minmax(0, 1fr)); gap: 4px; flex: 1; min-width: 0; }
.partner-month-picker button, .partner-month-dialog button {
  box-sizing: border-box;
  width: auto !important;
  min-width: 44px;
  min-height: 44px;
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #526b88;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transform: none !important;
  -webkit-tap-highlight-color: transparent;
}
.partner-month-picker button:focus-visible, .partner-month-dialog button:focus-visible { outline: 3px solid #76a9fa; outline-offset: 2px; }
.partner-month-picker button:disabled { opacity: 1; cursor: default; }
.partner-month-picker .pm-quick-month { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; height: 44px; padding: 0 2px; }
.partner-month-picker .pm-quick-month:hover:not(:disabled) { background: #edf4ff; color: #164b99; }
.partner-month-picker .pm-quick-month[aria-pressed="true"] { background: #1267d9; color: #fff; box-shadow: 0 2px 5px #1267d926; }
.partner-month-picker .pm-cross-year .pm-quick-month { height: 52px; }
.pm-tab-year { font-weight: 400; font-size: 14px; line-height: 16px; }
.partner-month-picker .pm-archive { display: grid; place-items: center; flex: 0 0 44px; width: 44px !important; height: 44px; background: #f1f6fd; color: #345a8c; }
.partner-month-picker .pm-archive:hover:not(:disabled), .partner-month-picker .pm-archive[aria-expanded="true"], .partner-month-picker .pm-archive.pm-archived-selection { background: #e0edff; color: #164b99; }
.pm-archive svg, .partner-month-dialog svg { display: block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pm-caption { display: flex; align-items: center; gap: 6px; min-height: 20px; margin: 8px 0 0; color: #52657d; font-size: 14px; line-height: 20px; }
.pm-current-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #208356; }
.partner-month-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: auto;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d2dfef;
  border-radius: 16px;
  background: #fff;
  color: #1e2a6b;
  font: inherit;
  box-shadow: 0 12px 32px #16335b19, 0 3px 8px #16335b08;
}
.partner-month-dialog[open] { display: flex; flex-direction: column; }
.partner-month-dialog::backdrop { background: transparent; }
.pm-grabber { display: none; }
.pm-dialog-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid #eaf0f7; }
.partner-month-dialog .pm-dialog-header h2 { margin: 0; color: #1e2a6b; font-size: 18px; line-height: 24px; letter-spacing: -.02em; }
.pm-dialog-header p { margin: 3px 0 0; color: #52657d; font-size: 14px; line-height: 20px; }
.partner-month-dialog .pm-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px !important; height: 44px; background: #f4f7fb; color: #435d80; }
.partner-month-dialog .pm-close:hover { background: #e7f0fc; }
.pm-years { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pm-year-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid #edf1f7; color: #52657d; font-size: 14px; line-height: 20px; }
.pm-year-heading h3 { margin: 0; color: #52657d; font-size: 14px; font-weight: 700; line-height: 20px; }
.pm-year-heading span { font-weight: 400; }
.pm-month-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.partner-month-dialog .pm-month { display: flex; align-items: center; gap: 10px; width: 100% !important; min-height: 52px; padding: 10px 12px; border: 1px solid transparent; color: #263f60; font-size: 16px; line-height: 22px; text-align: left; }
.partner-month-dialog .pm-month:hover { background: #f5f8fd; }
.partner-month-dialog .pm-month[aria-pressed="true"] { border-color: #d1e2fc; background: #edf4ff; color: #164b99; }
.pm-month-name { margin-right: auto; }
.pm-current { padding: 2px 8px; border: 1px solid #c8e6d6; border-radius: 6px; background: #ecf9f2; color: #176044; font-size: 14px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.pm-month svg { width: 19px; height: 19px; color: #1267d9; }
.pm-note { display: flex; flex: none; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; border-top: 1px solid #eaf0f7; background: #fcfdff; color: #52657d; font-size: 14px; font-weight: 400; line-height: 20px; }
.pm-note svg { width: 16px; height: 16px; color: #52657d; }
@media (max-width: 760px) {
  .partner-month-picker { flex: none; width: 100%; }
  :root.pm-month-modal-open { overflow: hidden; }
  .partner-month-dialog {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px - env(safe-area-inset-bottom));
    border-radius: 20px;
    box-shadow: 0 16px 44px #142b4a33;
  }
  .partner-month-dialog::backdrop { background: #102c514d; backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px); }
  .pm-grabber { display: block; flex: none; width: 34px; height: 4px; margin: 9px auto 0; border-radius: 5px; background: #cad5e4; }
  .pm-dialog-header { padding: 6px 14px 8px; }
  .partner-month-dialog .pm-month { min-height: 54px; }
  .pm-month-list { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .partner-month-picker button, .partner-month-dialog button { transition: none !important; }
}